No, there is no "official" way to do it. You can handle all its events by calling some save sub, which will button.PerformClick, or, if you plan to behave such manner in wider range in project, you can easily create some class, which, for example inherited from arraylist, will for every Overrides Sub Add(control) assign handler (e.g. AddHandler control.TextChanged, AddressOf Me.TextBoxes_TextChanged) depending on control.gettype.lowestbasetype (or just type, if you are not creating some extra controls with inheriting). This inherited collection will then have Public Event ValueChanged(sender as object, field as control) which will be Raised in all such event handlers.
Pseudo sample:
Class evtCollector
Inherits ArrayList
Public Event ValueChanged(Sender, Field)
Private Sub TextBoxes_TextChanged(sender As Object, args As ...) ---HANDLER
RaiseEvent ValueChanged(Me, sender)
End Sub
...another HANDLERS for different controls you use
Public Overrides Function Add(c as control) As Integer
If c.GetType.Equals(TextBox)
AddHandler c.TextChanged, AddressOf Me.TextBoxes_TextChanged
Else
AddHandler c.ValueChanged, AddressOf Me.NumericUDs_ValueChanged
..
MyBase.Add(c)
End Function
After such implementation you simply create Withevents group1, group2 ... As evtCollector
and in sub new of form you fill them... and handle its event
Enter your message below
Sign in or Join us (it's free).