[Gambas-user] Re ferencing existing multiple controls in loops

jbskaggs jbskaggs at ...1871...
Mon Mar 30 22:55:00 CEST 2009


Okay I have a form with say 50 picturebox controls:

How does one check each controls in a loop?

So if I wanted to have a big picture box reference each of the previous
pictureboxes


In GML I could use this:

a="PictureBox"
for i = 0 to 50 step 1
b=a&i
BigPicturebox.Picture=b.picture
wait 2
next i

But In gambas I cannot reference a control with a string.  I have tried
dozens of ways and spent eleven hours reading the docs, looking at examples,
and so on.  But the solution eludes me.

It seems really inefficient to type out

Bigpicturebox.picture=picturebox1.picture
wait 2.0
Bigpicturebox.picture=picturebox2.picture
wait 2.0
Bigpicturebox.picture=picturebox3.picture
wait 2.0
Bigpicturebox.picture=picturebox4.picture
wait 2.0

etc... fifty times

I am using pictureboxes but it could be any existing control I would want to
control from another event.
-- 
View this message in context: http://www.nabble.com/Referencing-existing-multiple-controls-in-loops-tp22792680p22792680.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list