[Gambas-user] How to specify action button at runtime

Ron ron at ...1740...
Wed Jul 15 17:14:53 CEST 2009


>
>>> my problem now is how to set the click action and how to know which
>>> button
>>> is clicking
>>>
>>>       
>> Use this instead:
>>
>> m_button = NEW Button(ScrollView1) AS "MyButton"
>>
>> Set the .Tag property to something unique:
>>
>> .Tag = iUnique
>>
>> And then catch the clicks with:
>>
>> PUBLIC SUB MyButton_Click()
>>   Message.Info("Clicked : " & LAST.tag)
>> END
>>
>>     

>> By the way , how do I delete all the button in the scroll view. 
>>     
Maybe with something like this: (note: this will delete all children so 
maybe also non button objects)

DIM oObject AS Object

FOR EACH oObject IN Scrollview1.Children
    oObject.Delete()
NEXT

Regards,
Ron_2nd.




More information about the User mailing list