[Gambas-user] Control groups

Grahame White grahame at ...457...
Tue May 25 19:24:12 CEST 2004


On Sunday 23 May 2004 23:12, Grahame White wrote:
> I've been playing with control groups created at runtime a bit but I'm
> not sure how to reference the created controls from another sub as the
> array of controls is declared using DIM within the startup routine.
>
> Currently I have something like this
>
> fmain.class
>
> public sub form_open()
>
> 	dim mygroup[100] as new picturebox
> 	dim i as byte
>
> 	for i = 1 to 100
> 		mygroup[i] = new picturebox(me) as "mypics"
> 	next
>
> 	' Some more code to arrange the picboxes into a grid
>
> end
>
> Which works fine. However when I try to make a separate helper sub to
> manipulate the grid I'm not sure how to refer to the created
> pictureboxes.
>
> An example of a simple sub is
>
> public sub hide_picbox(index as byte)
>
> 	mygroup[index].visible = false
>
> end
>
> Obviously the above doesn't work but the intention is there and is what
> I've been trying to work out.
>
> I tried declaring mygroup so that it was within scope of the entire file
> but that ended up messy (that is I ended up making it messy :))
>
> Grahame
>
> PS Contry to the evidence I am learning :)


I've attached what I have so far so that you can see what I'm trying to 
achieve.

Grahame
-------------- next part --------------
A non-text attachment was scrubbed...
Name: board.tar.gz
Type: application/x-tgz
Size: 3328 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040525/ebfd5ea3/attachment.bin>


More information about the User mailing list