Results 1 to 3 of 3

Thread: Create Popup Menus without a Form in VB

  1. #1
    Join Date
    Dec 2008
    Posts
    10

    Create Popup Menus without a Form in VB

    Hello Friends,

    I am developing a small application using Visual Basic 6.0.
    I want to create a right click menu for my application. so that when user click on form some popup menus would appear.

    but i don't know how to create a right click menu in VB.

    Please help.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Create Popup Menus without a Form in VB

    Creating a popup menu in your Visual Basic program is very simple, just one line of code(within a IF statement). You usually put it in objects MouseDown procedure. First you need to create your menu using the Menu Editor. In my example, I have made the menu invisible at run-time.

    To bring up a menu you code is this simple:

    Set popupMenu = New BX_MNU.popupMenu

    Call popupMenu.AddStringMenuItem("One", 0)
    Call popupMenu.AddStringMenuItem("Two", 1)
    Call popupMenu.AddStringMenuItem("Three", 2)
    Call popupMenu.AddSeparatorMenuItem
    Call popupMenu.AddStringMenuItem("Four", 3)

    Call popupMenu.ShowPopupMenu

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Create Popup Menus without a Form in VB

    The code to make the menu popup is:-

    If Button = vbRightButton Then PopupMenu Me.mnuPopup

    If you want to use the left button for the menu to popup, use vbLeftButton instead of vbRightButton.

Similar Threads

  1. How to create a popup reminder in blackberry 9780
    By Daler Mehndi in forum Portable Devices
    Replies: 1
    Last Post: 04-04-2012, 03:39 PM
  2. How to create Menus in Java Application?
    By Zecho in forum Software Development
    Replies: 3
    Last Post: 30-11-2009, 01:40 PM
  3. Procedure in VB to create form inside another form
    By Jalabala in forum Software Development
    Replies: 3
    Last Post: 16-11-2009, 02:14 PM
  4. How to create popup bulloon in acrobat reader
    By Avanindra in forum Windows Software
    Replies: 3
    Last Post: 19-05-2009, 11:32 AM
  5. How to create Form within Form in VB
    By StephanieRice in forum Software Development
    Replies: 2
    Last Post: 20-04-2009, 01:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,099,944.27096 seconds with 16 queries