[Gambas-user] control groups

Daniel Campos daniel.campos at ...338...
Sat Feb 21 22:35:02 CET 2004


El sáb, 21-02-2004 a las 22:17, Joao Pinto escribió:
> Hello,
> are control groups working ?
> I have tried the following example from the help but the click event 
> code is not being executed.
> 
> ..
> ' Gambas class file
> STATIC PUBLIC SUB Main()
>   DIM FMain AS Form
>   DIM hButton[3] AS Button

mmmhh... you are using three objects that just exists in the SUB Main(),
I mean in that function scope... may be you should define them as
'PUBLIC' or 'PRIVATE' in the begging of the formulary, not into a
method,I think this is the problem 

>   FMain = NEW Form1
>  
> 
> hButton[0] = NEW Button(Fmain) AS "MyButtons"
> hButton[0].Text = "Red"
> 
> hButton[1] = NEW Button(Fmain) AS "MyButtons"
> hButton[1].Text = "Green"
> hButton[1].Y = 50
> 
> hButton[2] = NEW Button(Fmain) AS "MyButtons"
> hButton[2].Text = "Blue"
> hButton[2].Y = 100
>   FMain.show
> END
> PUBLIC SUB MyButtons_Click()
> 
>   lblTxt.text = LAST.Text
> END
> ..





More information about the User mailing list