Need help about switching betwean two pictures..

cabron's Avatar, Join Date: Nov 2010
Newbie Member
Hi
can anybody please tell me how to put two pictureboxes in a form...one on top of the other with allowing the user to switch betwean the pictures when he clicks on one of them....like if the user clicks on one picture, it should be on top of the other...plz sombody help me ASAP
0
virxen's Avatar, Join Date: Nov 2009
Pro contributor
try having 2 picture boxes with the same dimensions and same position on the form

and write this code

Code:
Private Sub Picture2_Click()
Picture2.Visible = False
Picture1.Visible = True
End Sub
Private Sub Picture1_Click()
Picture1.Visible = False
Picture2.Visible = True
End Sub

but if you mean in different dimensions or position try this instead
Code:
Private Sub Picture2_Click()
Picture1.ZOrder 1
Picture2.ZOrder 0
End Sub
Private Sub Picture1_Click()
Picture2.ZOrder 1
Picture1.ZOrder 0
End Sub

Last edited by virxen; 9Nov2010 at 05:53..
shabbir like this
0
cabron's Avatar, Join Date: Nov 2010
Newbie Member
thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanks alooot .......im getting the 3 bonus marks for my midterm tommorow..ur the best