09-24-2014, 10:54 AM
* Guru *
Join Date: Jun 2003
Location: Upstate New York, usa
You have which picturebox you show reversed.
You can only click on a visible box, so that is the one you want to hide, and show the other.
You shouldn't have to assign the image in each click even.
Just load the image in each picturebox in the Form's Load event.
In Fact, you are loading the image twice in memory, but you could just load it once, and have both pictureboxes reference the same image.
'In the Form load event
LargePictureBox.Image = My.Resource.CDROM01
SmallPictureBox.Image = LargePictureBox.Image
Private Sub CDPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LargePictureBox.Click
LargePictureBox.Visible = False
SmallPictureBox.Visible = True
Private Sub SmallPictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SmallPictureBox.Click
SmallPictureBox.Visible = False
LargePictureBox.Visible = True
I assume you have the SizeMode of the pictureboxes set to Stretch or Zoom, and they are different size pictureboxes.
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.