[Gambas-user] Button Transparency

Bruce Steers bsteers4 at gmail.com
Wed Oct 28 10:35:33 CET 2020


>
> How do cater for a click event (or mouse up) on a dynamically created
> control?
>

Use the As keyword.

Eg define/create the the button as so...
Dim MyButton As Button
MyButton = New Button(parent) As "My_Button"
MyButton.Text = "Button 1"

Then you can use something like..

Public Sub My_Button_Click()
If Last.Text = "Button 1" Then
EndIf
End

That way you can assign multiple buttons the same event name and use the
Events "Last" keyword to get what button it is calling.

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201028/9a774319/attachment.htm>


More information about the User mailing list