Hello...
How do I set a Popup-Menu that will be shown every time I
right-click on a PictureBox ?
Thanks in advance,
Lior.
P.S: Please answer me fast,
the answer is really important for me.
Printable View
Hello...
How do I set a Popup-Menu that will be shown every time I
right-click on a PictureBox ?
Thanks in advance,
Lior.
P.S: Please answer me fast,
the answer is really important for me.
Right. Create a menu using the menu editor, but set the visible property to false.
Now, on your picture box, put if button = 2 then Popup(Name of menu) under the mouse down event
Here is the codeOn your form create a primary level menuitem with a caption of anything you want, a name of mnuBtnContextMenu and Visible [pi]not[/i] checked. Alo create a submenu item below that with a caption of What's This?, a name of mnuBtnWhatsThis, and Visible checked. That's it :)Code:Option Explicit
Private ControlClicked As Control
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
Set ControlClicked = Picture1
PopupMenu mnuBtnContextMenu
End If
Set ControlClicked = Nothing
End Sub
------------------
Marty