PDA

Click to See Complete Forum and Search --> : Popup-Menu, Please help me. real thanks.


Lior
Jan 17th, 2000, 03:08 AM
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.

markwestcott
Jan 17th, 2000, 03:52 AM
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

MartinLiss
Jan 17th, 2000, 04:00 AM
Here is the codeOption 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

On 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 :)

------------------
Marty