Combining Event Handlers
Posted
#1
(In Topic #734)
Enthusiast

For example, I have 3 buttons named… btnDoSomething1 btnDoAnything1 btnDoSomething2
I want them all to fire the event btnDoSomething1_click rather than each have it's own click event.
Posted
Guru

sadams54 said
Sorry to be asking so much however I am wondering if there is a way to make several controls all fire the same handler.
For example, I have 3 buttons named… btnDoSomething1 btnDoAnything1 btnDoSomething2
I want them all to fire the event btnDoSomething1_click rather than each have it's own click event.
Sure just set the Group
If they all have the Group "MyButts"
then MyButts_Click will be useable.
(the IDE will auto-goto event handler on double clicking if a group is set.)
Posted
Guru

Code (gambas)
- ''All this is to add components to the Form
- .Height = 215
- .Width = 215
- .Padding = 5
- .Arrangement = Arrange.None
- .Center
- .Y = iLoop * 50
- .X = 20
- .W = 175
- .H = 28
- .Name = sButtonNames[iLoop]
- .Text = sButtonNames[iLoop]
- .Y = iLoop * 50
- .X = 20
- .W = 175
- .H = 28
- .Alignment = Align.Center
- .Border = Border.Plain
1 guest and 0 members have just viewed this.



