A
Anil Gupte
I created a button dynamically and added an event hander as follows:
AddHandler newbtnPick.Click, AddressOf newbtnPick_Click
Private Sub newbtnPick_Click()
End Sub
I get an error:
Method 'Public Sub newbtnPick_Click()' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)'.
So of coutse I added
ByVal sender As Object, ByVal e As EventArgs
to give me
Private Sub newbtnPick_Click(ByVal sender As Object, ByVal e As EventArgs)
End Sub
In fact even this does nto work:
Private Sub newbtnPick_Click(ByVal sender As Object)
End Sub
Why do I need the second parameter? And I am curious, how does it know I
will need the sender object?
Thanx,
AddHandler newbtnPick.Click, AddressOf newbtnPick_Click
Private Sub newbtnPick_Click()
End Sub
I get an error:
Method 'Public Sub newbtnPick_Click()' does not have the same signature as
delegate 'Delegate Sub EventHandler(sender As Object, e As
System.EventArgs)'.
So of coutse I added
ByVal sender As Object, ByVal e As EventArgs
to give me
Private Sub newbtnPick_Click(ByVal sender As Object, ByVal e As EventArgs)
End Sub
In fact even this does nto work:
Private Sub newbtnPick_Click(ByVal sender As Object)
End Sub
Why do I need the second parameter? And I am curious, how does it know I
will need the sender object?
Thanx,