|
-
Jun 29th, 2005, 07:38 PM
#1
Thread Starter
Frenzied Member
Pop-Up Menu - Resolved
How do I go about making a pop-up menu appear when the user clickes on an item (such as a cell in a list box)?
Last edited by RudyL; Jun 29th, 2005 at 08:10 PM.
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Jun 29th, 2005, 07:49 PM
#2
Re: Pop-Up Menu
To start you need to drag a ContextMenu from the toolbox to your form.
Then add menu items to it and the click event procedures.
Then assign the CM to your listbox control.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 29th, 2005, 07:54 PM
#3
Re: Pop-Up Menu
Couldn't you use a context menu, and use:
ContextMenu1.show(control_name, System.Windows.Forms.Form.MousePosition)
on the click handler?
Bill
-
Jun 29th, 2005, 07:56 PM
#4
Re: Pop-Up Menu
Then you would still need to dynamically add menu items and Handlers to it.
Its easier to start with the GUI CM control and go from there unless you already know how to do it all dynamically at run time.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jun 29th, 2005, 08:04 PM
#5
Re: Pop-Up Menu
 Originally Posted by RobDog888
Then you would still need to dynamically add menu items and Handlers to it.
Its easier to start with the GUI CM control and go from there unless you already know how to do it all dynamically at run time. 
Good point. See, when you learn from books, they don't tell you "It's easier to just click and drag". Good to know how to do it dynamically too though, eh?
Bill
-
Jun 29th, 2005, 08:09 PM
#6
Thread Starter
Frenzied Member
Re: Pop-Up Menu
 Originally Posted by RobDog888
To start you need to drag a ContextMenu from the toolbox to your form.
Then add menu items to it and the click event procedures.
Then assign the CM to your listbox control.
Thank you!! Works exactly like I need..
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Jun 29th, 2005, 08:10 PM
#7
Re: Pop-Up Menu - Resolved
Yes, actually I have read things stating that if you use the GUI on things its the exact same thing as doing it
dynamically. Iam not too sure since, like a timer for ex., your filesize will be larger then if you created one dynamically
through code. I dont see how they could differ since the GUI version only dynamically generates the code for you
and add a very small addition to your forms resource file.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|