R
Rob Nicholson
A thought - has VB.NET been extended to be able to handle arrays or
collections with events? A problem with VB6 was that you could only declare:
Private WithEvents MyControl As MyControl
Private Sub MyControl_Click()
End Sub
which could track one control on the form. If you happened to have code that
add N controls at runtime, you had to create a wrapper class to capture the
event, i.e. one object per control with the class containing the WithEvent
declaration. I'd expect something like:
Private WithEvents MyControls() As MyControl
Private Sub MyControls_Click(Index As Integer)
End Sub
Hmm, I'm guessing not as it's not ringing any bells.
Cheers, Rob.
collections with events? A problem with VB6 was that you could only declare:
Private WithEvents MyControl As MyControl
Private Sub MyControl_Click()
End Sub
which could track one control on the form. If you happened to have code that
add N controls at runtime, you had to create a wrapper class to capture the
event, i.e. one object per control with the class containing the WithEvent
declaration. I'd expect something like:
Private WithEvents MyControls() As MyControl
Private Sub MyControls_Click(Index As Integer)
End Sub
Hmm, I'm guessing not as it's not ringing any bells.
Cheers, Rob.