Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable usage 1

Status
Not open for further replies.

chriisb

Programmer
Mar 13, 2003
28
US
hey,

i'm just a beginner trying to figure a few things out. i'm making a program in which about 30 differnt picture boxes must be tested constantly for certain position constraints, and if the constraints are true, i need to make the picture invisible. i managed to get the program to cycle through the constraints by using an array of the position of each picture, and then using a variable(A)i cycle through each picture, but if the constraints are true i dont know how to get the picture to become invisible easily. i wanted to do something like
pictureA.visible = False
but when i try it my program keeps locking up, is it just my computer, or is that illegal? if it's illegal any advice on this matter would be greatly appreciated.

thanks
 
const MaxNumPics as integer = 30

for i=0 to MaxNumPics
'assumes your pic array is called PicArray() and you
'want to see where the top of the picture is.
if PicArray(i).top >= YourConstraint then
PicArray(i).visible=false
end if
next i

(just in case: to create PicArray just name the first PictureBox to "PicArray" and set the index to 0 then copy and paste)

good luck If somethings hard to do, its not worth doing - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top