Hi All
I have a quick question regarding multiple picture boxes.
I am trying to design a basic version of spaceinvaders. I have 6 pictureboxes on my form and the idea is to add a value to the picbox.top property that moves the boxes down at a certain time and speed that i have set in my timer control.
The problem i have is i am trying to set properties for all the pictureboxes at the same time by using arrays.
An example would be
'and so on
I am unable to alter the top property collectively for all the boxes. it works fine for each individual box.
Can anyone tell me how I would go about that.
Also when it comes to chaging the top property, my code snippet in my timer_tick even would include
The above works fine and would move pic1 down the form everytime the timer ticks (interval is set at 500 milliseconds).
I want to be able to move all picboxes down the form by using the array method as supposed to individually and carry on with any other relevant coding from there.
I hope the above makes sense but please contact me if you need to clarify any of the above.
I have a quick question regarding multiple picture boxes.
I am trying to design a basic version of spaceinvaders. I have 6 pictureboxes on my form and the idea is to add a value to the picbox.top property that moves the boxes down at a certain time and speed that i have set in my timer control.
The problem i have is i am trying to set properties for all the pictureboxes at the same time by using arrays.
An example would be
VB.NET:
dim mypic() as picturebox = {pic1, pic2, pic3, pic4, pic5, pic6}
pic1.top = 10
pic2.top = 10
'and so on
I am unable to alter the top property collectively for all the boxes. it works fine for each individual box.
Can anyone tell me how I would go about that.
Also when it comes to chaging the top property, my code snippet in my timer_tick even would include
VB.NET:
static a as integer
a = pic1.top
a += 1
pic1.top = a
exit sub
The above works fine and would move pic1 down the form everytime the timer ticks (interval is set at 500 milliseconds).
I want to be able to move all picboxes down the form by using the array method as supposed to individually and carry on with any other relevant coding from there.
I hope the above makes sense but please contact me if you need to clarify any of the above.