Results 1 to 5 of 5

Thread: adding a right-click menu

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34

    Question

    OK, I guess there is only one way to say this:

    How do I do it? I've never had to. I know VB fairly well, don't be discouraged, just point me in the right direction.

  2. #2
    Guest
    Click Tools > Menu Editor and type in your Menu there.

    File > MnuFile
    ....About > MnuAbout
    ....Exit > mnuExit

    Edit > MnuEdit
    ....Cut > MnuCut
    ....Copy > MnuCopy
    ....Paste > MnuPaste
    'etc.
    'etc.

    And in a MouseDown event, can be any control, put this:

    Code:
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then PopupMenu mnuFile
    End Sub
    
    'If menu is on another form:
    
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then PopupMenu Form2.mnuFile
    End Sub


    [Edited by Matthew Gates on 10-11-2000 at 04:31 PM]

  3. #3
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Talking Not hard!!

    make a menu item in the Menu bar editor and set its Visible property to false, e.g. make mnuHelp, and some items below it, and set mnuHelp's visible property to false

    then in the mousedown event of the Form or whatever control you want to use:
    Code:
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    If Button = vbRightButton Then
        frmPrincipal.PopupMenu mnuHelp
    End If
    
    End Sub

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    34

    Cool

    ROCK! Thanks all, I'm all set... this place kicks assmar.

  5. #5
    Guest

    Talking

    Can we have a menu bar on the form like file save.... those, but i need pop up menu bar also... so, can i have 2 menu bars at the same time? or can i just show part of the menu bar in the pop up menu bar?

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