Solved

Create a popup menu

Posted on 2001-06-05
8
189 Views
Last Modified: 2012-05-04
I have a form within a class.  I want to create a popup menu for this form.  I don't want the menu to be dependent on the project form.  I want it contained within the class.

It seems that the menu is not a VB control type.

I have a ListView with a CommandButton over it.  I want a popup menu to appear when someone right-clicks on the CommandButton.

The problem is that I can't find a way to create a menu from within my class.  Since the only way to use the PopupMenu method is to have a menu associated with a form it is difficult to find a way around this.

Any suggestions would be appreciated.

Thanks!

Rich

0
Comment
Question by:RichW
8 Comments
 

Expert Comment

by:OTveit
Comment Utility
You can create your own menu using another form within the same class and use the Show/Hide methods inside the command buttons Mouse down/up event.


:)
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
0
 
LVL 4

Author Comment

by:RichW
Comment Utility
I know, but I was hoping instead that there was a way to create a popupMenu from the form in my class instead of creating a form.

I could also do it with a label.  

I think the answer is no.

Thanks anyway.


0
 
LVL 2

Accepted Solution

by:
chandukb earned 100 total points
Comment Utility
Hi,

Another Link:

http://www.planet-source-code.com/xq/ASP/txtCodeId.14792/lngWId.1/qx/vb/scripts/ShowCode.htm

I am using this in my VB Project, and it's great.

Chandu
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Don't give up so quickly....
0
 
LVL 8

Expert Comment

by:glass_cookie
Comment Utility
Hi!

I don't know if this would be applicable to your question, but, just in case this is what you're actually trying to achieve...

I you want to popup the menu (which is called MyMenu) from Form1 IN Form2, in form2, simply add this code:

PopupMenu Form1.MyMenu

That's it!

glass cookie : )

PS Ignore me if this is inapplicable
0
 
LVL 4

Author Comment

by:RichW
Comment Utility
Thanks chandukb.  That was what I was looking for.

Thanks again.

RichW
0
 
LVL 4

Author Comment

by:RichW
Comment Utility
Thanks everyone for your input!

RichW
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now