Results 1 to 3 of 3

Thread: Popup-Menu, Please help me. real thanks.

  1. #1

    Thread Starter
    Registered User Lior's Avatar
    Join Date
    Jan 2000
    Posts
    307

    Post

    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.

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Posts
    79

    Post

    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

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Here is the code
    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
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width