Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Need help about switching betwean two pictures.. (http://www.go4expert.com/forums/help-switching-betwean-pictures-t23802/)

cabron 9Nov2010 02:06

Need help about switching betwean two pictures..
 
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 :embarasse

virxen 9Nov2010 05:47

Re: Need help about switching betwean two pictures..
 
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


cabron 9Nov2010 05:59

Re: Need help about switching betwean two pictures..
 
thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanks alooot :D.......im getting the 3 bonus marks for my midterm tommorow..ur the best :2thumbsup


All times are GMT +5.5. The time now is 00:22.