Results 1 to 3 of 3

Thread: close popup menu

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Cool

    when I right-click on my form, a popup menu appears, but if I right-click again, the menu stays where it is, how do I get it to move to where I click?
    P.S. - I tried:
    Code:
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If (Button = 2) Then
        PopupMenu mnuEdit, , X, Y
    End If
    End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'make a popup menu just like the one's in windows
    'appear at the right click of your mouse as long
    'as your right click is on the form
    
    Option Explicit 
    
    Private Sub Form_Load() 
       mnuPop.Visible = False 
    End Sub 
    '
    'allow users the ability of win keyboard menu key
    
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) 
        If KeyCode = 93 Then 
            'fire up the popup menu 
            PopupMenu mnuPop, 2, 60, 60 
        End If 
    End Sub 
    
    Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 
        If Button = vbRightButton Then 
            'fire up the popup menu 
            PopupMenu mnuPop, 2, X, Y 
        End If 
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Guest
    Just to let you know, the constant for 2 here:
    PopupMenu mnufile, 2, X, Y
    is:
    PopupMenu mnufile, vbPopupMenuRightButton, X, Y

    some useless information, but may help in the future and help you to understand a bit more that you can use constants and not numbers.

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