كود نسخ سهل الاستخدام

القيصر

New member
26 فبراير 2019
1,003
0
0
كود نسخ سهل الاستخدام

الأدوات: button عدد2+textbox

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Text = "نسخ"
Button2.Text = "مسح"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text <> "" Then
Button2.Enabled = True
Button1.Enabled = True
Else
Button2.Enabled = False
Button1.Enabled = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
End Sub
‘هذا فقط كود النسخ
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Clipboard.Clear()
Clipboard.SetText(TextBox1.Text)
End Sub
End Class