[Gambas-user] Find a button who was pressed

Stefano Palmeri stefanopalmeri at ...152...
Mon Sep 4 13:18:45 CEST 2006


Alle 11:18, lunedì 4 settembre 2006, rolf ha scritto:
> But getting the click event from the buttons it requires a public sub for 
each 
> button. Is it possible to put the buttons also into an array and how to find 
> out, which button was pressed?
> 
> Many thanks for your suggestions
> Rolf

In the panel property for every button you want to put in the "array"
set a common name for all for the property "Group"
For example you set "AllButtons" as group name.

Then in the code you have to

PUBLIC SUB AllButtons_click()

   if LAST.text = pressed_button_text THEN blahblah

ENDIF

you can use other properties to know which button
was pressed, like LAST.X et cetera.

Regards,

Stefano Palmeri








More information about the User mailing list