for loop to cycle trough objects ?  
Author Message
gijshompes





PostPosted: Visual Basic General, for loop to cycle trough objects ? Top

How can I automate this. I have 81 imageboxes and they are all enumerated like this.

Pict1,Pict2 ,...,Pict81

Is there a way to do something like this

for i=1 to 81
pict[ i ].creategraphics
Next

So that I can automate a lot instead of making over 3 times 81 lines of code for nothing

Thanks in advance



Visual Basic23  
 
 
nobugz





PostPosted: Visual Basic General, for loop to cycle trough objects ? Top

For ix As Integer = 1 to 81
Dim pic As PictureBox = Me.Controls("Pict" + CStr(ix))
If pic IsNot Nothing Then
...
End If
Next



 
 
gijshompes





PostPosted: Visual Basic General, for loop to cycle trough objects ? Top

thanks:)