View Single Post
 
Old 09-24-2014, 10:37 AM
FireSlade FireSlade is offline
Newcomer
 
Join Date: Sep 2014
Posts: 3
Question changing image in picture box by clicking image

Hey everyone, I've been searching through the forum trying to find a solution to this problem, and I've seen some similar issues, but not exactly what I need an answer to.

I'm trying to get an image in a picture box to toggle between a large and small version of the same image. I've made 2 picture boxes and overlapped the smaller one on top of the large one. The large picture box visible is set true and small is set false. I can't figure out the code that will allow me to swap those properties, by clicking on the image, so that the small picture becomes true and is visible and the large picture becomes false. This is the code I put for the large picture box:

Private Sub CDPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LargePictureBox.Click
' Large CD image

LargePictureBox.Image = My.Resources.CDROM01
LargePictureBox.Visible = True
SmallPictureBox.Visible = False

End Sub

Small:

Private Sub SmallPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SmallPictureBox.Click
' Small CD Image

SmallPictureBox.Image = My.Resources.CDROM01
SmallPictureBox.Visible = True
LargePictureBox.Visible = False

End Sub

I know there's probably a very simple solution to this that I'm completely overlooking, but I just can't get it. Any help would be greatly appreciated. Thanks.
Reply With Quote