20-01-18, 09:49 PM
السلام عليكم
PHP كود :
Public Class Form1
Dim MeL As Integer, SS As String, oo As System.Object
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Newbutton As New Button
Newbutton.Text = InputBox("Ente Text:")
Newbutton.Name = InputBox("Ente Name:")
Newbutton.Left = MeL
MeL += Newbutton.Width
SS = Newbutton.Name
Controls.Add(Newbutton)
AddHandler Newbutton.Click, AddressOf nebe
End Sub
Private Sub nebe(ByVal sender As System.Object, ByVal e As System.EventArgs)
oo = sender
Events1()
End Sub
Function Events1()
If oo.ToString.Contains("Button1") Then
MsgBox("تم الضغط على زر1")
ElseIf oo.ToString.Contains("Button2") Then
MsgBox("تم الضغط على زر2")
End If
'\\: الكود المطلوب
'\\ اذا كان اسم الزر = "زر1" بعد ذلك تطبيق الحدث
'\\ if oo.name = "Button1" then Msgbox("Button1") end if
End Function
End Class