Action, the class and the property

User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Action, the class and the property

Post by gbWilly » Wednesday 20th November 2019 5:08pm

Hi,

If you want separate events getting triggered by different controls you should have a look at group.
You will find it in menu items as well as on controls.

Image

Image

Say you have a few controls in a group named "Test".
Right clicking one of the controls in this group and selecting Event -> Click will give you this code:
Public Sub Test_Click()

   'Your code here

End
Now all controls in group Test will run this code when clicked on.
If you would right click one of the controls in the group Test again and select Event -> DblClick it would result in this code:
Public Sub Test_Dblclick()

   'Your code here

End
In this manner you can handle multiple events for a group of controls with the same event handler.
Quite handy.

Action I usually only use to enable/disable controls or make them visible or not.

My 2 cents on the matter.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

User avatar
sjsepan
Posts: 51
Joined: Saturday 12th October 2019 10:11pm
Location: Leeper, PA, USA
Contact:

Re: Action, the class and the property

Post by sjsepan » Wednesday 20th November 2019 6:16pm

gbWilly,
Thanks! I had not looked closely at Group because of the name, where in VB I might group controls like radio-buttons to act as different values associated with one field.
I'll have to have a closer look...
Steve
__________
gbWilly wrote:
Wednesday 20th November 2019 5:08pm
Hi,

If you want separate events getting triggered by different controls you should have a look at group.
You will find it in menu items as well as on controls.

...

Now all controls in group Test will run this code when clicked on.
If you would right click one of the controls in the group Test again and select Event -> DblClick it would result in this code:

...

In this manner you can handle multiple events for a group of controls with the same event handler.
Quite handy.

Action I usually only use to enable/disable controls or make them visible or not.

My 2 cents on the matter.

Post Reply