Dear vb dotnet users,
Via a class we can make a button but how can be an event inserted?
Hope you can help us.
Michelle.
Used code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
create_button.setButton(Me)
End Sub
Public Class create_button
Public Shared Sub setButton(ByVal frm As Form)
Dim cb As New Button
With cb
.Location = New System.Drawing.Point(50, 50)
.Size = New System.Drawing.Size(150, 30)
.Text = "how to get an even?"
frm.Controls.Add(cb)
End With
End Sub
Private Sub cb_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("This doesnt work!")
End Sub
End Class
Via a class we can make a button but how can be an event inserted?
Hope you can help us.
Michelle.
Used code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
create_button.setButton(Me)
End Sub
Public Class create_button
Public Shared Sub setButton(ByVal frm As Form)
Dim cb As New Button
With cb
.Location = New System.Drawing.Point(50, 50)
.Size = New System.Drawing.Size(150, 30)
.Text = "how to get an even?"
frm.Controls.Add(cb)
End With
End Sub
Private Sub cb_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("This doesnt work!")
End Sub
End Class