VBwolf
07-09-2007, 04:20 PM
I looked at this posting:
http://www.xtremevbtalk.com/showthread.php?t=244968
But with that posting it creates multiple contextmenu, one for each picturebox. I would like to know if it would be possible to use one contextmenustrip for multiple picturebox. What I have is 6 picturebox and one contextmenustrip. When one of the picturebox is right clicked the contextmenustrip comes up and you can select and one of the menu items. What does not work is the changing of the picture of the picturebox. I have tried using "focused" for the picturebox but it does not work, example below:
Private Sub CMGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMGToolStripMenuItem.Click
If Slot1.Focused = True Then Slot1.BackgroundImage = imgadit.Images(1)
End Sub
How can I tell what picturebox is currently showing the contextmenustrip, so that I can change the picture accordingly.
Thanks for helping out.
http://www.xtremevbtalk.com/showthread.php?t=244968
But with that posting it creates multiple contextmenu, one for each picturebox. I would like to know if it would be possible to use one contextmenustrip for multiple picturebox. What I have is 6 picturebox and one contextmenustrip. When one of the picturebox is right clicked the contextmenustrip comes up and you can select and one of the menu items. What does not work is the changing of the picture of the picturebox. I have tried using "focused" for the picturebox but it does not work, example below:
Private Sub CMGToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMGToolStripMenuItem.Click
If Slot1.Focused = True Then Slot1.BackgroundImage = imgadit.Images(1)
End Sub
How can I tell what picturebox is currently showing the contextmenustrip, so that I can change the picture accordingly.
Thanks for helping out.