CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2001
    Posts
    29

    combo box - pop up menu

    When you right click on a combo box a menu pops up with the following. Undo,cut,copy,paste, delete, select all. i would like to add another item to that menu. Is it possible?
    Also I put a message box in the double click event of the combo box and when i double click nothing happens. Can someone please help me out?

    Thanks!!


  2. #2
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: combo box - pop up menu

    As far as the popup menu - The menu that you are getting is the Windows Standard menu, and this popup menu comes up when you right click in Windows. You cannot change this menu, but you can build a popup menu of your own and have this override the windows standard. Basically, build a popup menu, and make the new one come up during the right click. As for the message box in double click on the combo box - you may have to eliminate that. The combo box may not recognize a double click event as when you single click the menu drops down, and then another click pulls the menu back up. Without seeing the code, though, I can't say for sure if a double click would work.


  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: combo box - pop up menu

    I would like to add a note here, you can't trap the rightclick event of a combobox because of the lack of the MouseDown/MouseUp events.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  4. #4
    Join Date
    Mar 2001
    Posts
    29

    Re: combo box - pop up menu

    So there is no way to create a pop-up menu when you right click on a combo box?


  5. #5
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: combo box - pop up menu

    Try this, may be it will help you

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    mnufile.Visible = False

    If Button = 2 Then PopupMenu mnufile

    End Sub


    Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    mnufile.Visible = False
    If Button = 2 Then PopupMenu mnufile

    End Sub


    Private Sub Label2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    mnufile.Visible = False
    If Button = 2 Then PopupMenu mnufile

    End Sub

    ' on different contro;s we can call different popup menus

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured