Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-01-2009
Member
 
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.
Reply With Quote
  #2  
Old 26-01-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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
Reply With Quote
  #3  
Old 26-01-2009
Member
 
Join Date: May 2008
Posts: 2,293
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Create Popup Menus without a Form in VB"
Thread Thread Starter Forum Replies Last Post
How to create a popup reminder in blackberry 9780 Daler Mehndi Portable Devices 1 04-04-2012 03:39 PM
How to create Menus in Java Application? Zecho Software Development 3 30-11-2009 01:40 PM
Procedure in VB to create form inside another form Jalabala Software Development 3 16-11-2009 02:14 PM
How to create popup bulloon in acrobat reader Avanindra Windows Software 3 19-05-2009 11:32 AM
How to create Form within Form in VB StephanieRice Software Development 2 20-04-2009 01:40 PM


All times are GMT +5.5. The time now is 01:28 AM.