?
Solved

EASY - Popup menu in VB6

Posted on 2002-07-01
6
Medium Priority
?
562 Views
Last Modified: 2010-05-02
Hello everyone. I'm sure this must be an easy one.

I want to create a popup menu, on the right mouse click on a form.

I have looked in the help file and it tells me to create a popup menu using the menu editor. I have tried this, but it just creates a menu at the top of the form (or actually at the top of the main form as I am developing an MDI app).

What must I do to create a popup menu, that does not appear as a regular menu?

Thanks
0
Comment
Question by:DapperDan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7121733
You have to create the menu as normal menu and hide it (set visible of the main part to invisible. The name of the top menu could be for example mnuPopMyForm, and below (indended) the menu items you want to see when using the popup.

Then, on MouseUp of the Form, use this code:
PopupMenu mnuPopMyForm
Using the other parameters of this function, you will be able to influence the position and the behaviour, but the above is the least you need to do

CHeers

0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7121747
-Try this

As you have created the menu in the menu editor. Set its property to Visible=false ie the uncheck the visible property of the main menu

Suppose you have the foll
-Options (id-mnuOptions)
--File (id-mnuFile)
--Open (id mnuOpen)

and then write this...

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

PopupMenu mnuoptions

End Sub
------------------------------

Hope this helps

-priya


0
 

Author Comment

by:DapperDan
ID: 7121784
Thanks, to both of you.

I think you basically said the same thing. It's working now but I have one problem.

As I said earlier, this is an MDI app. Now when I click on a particular subform, it hides the main application menus, and replaces it with an empty menu (as the subform has no visible menus).

Is there a way of stopping the subform from replacing the main application menus? I suppose I could put the same menus into the subform, but this seems a bit sloppy.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 600 total points
ID: 7121815
In VB, this is unfortunately not possible unless you move the menus for the mdi Child forms into an activeX-control which you place onto the form and where you can negociate the menus places.
CHeers
0
 

Author Comment

by:DapperDan
ID: 7121833
OK, thanks. Using ActiveX seems a bit excessive here (:

I'll just have to duplicate the menus.
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7122631
oops, late posting..sorry DapperDan! I  think when I was writing the suggestion, something came up. So when I completed it later(ie after 7 minutes), a similar suggestion was aleady posted.

No probs, Hope you could find a solution to your problem. That's important.

-Priya

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question