473,378 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Context Menu on a ToolStripMenuItem

4
I am trying to mimic the functionality of a web browser's "Favorites" (or "Bookmarks") menu. I would like to be able to right-click on a ToolStripMenuItem and have a context menu appear so that I can list options such as "Open Page", "Delete Favorite", "Delete Folder", etc. Unfortunately the ToolStripMenuItem does not have a "ContextMenu" property like many other object in the System.Windows.Forms namespace.

If it was a TextBox, I would just create my context menu in the IDE and set the TextBox.ContextMenu to my menu and it would work, but that does not appear to be an option for ToolStrip objects.

Is there still some way that I can bring up a context menu that can reference the properties of the selected menu item?

I am coding in C# in .NET 2.0.
Jun 6 '07 #1
2 5578
Plater
7,872 Expert 4TB
The toolstrip itself has a contextmenustrip option
Jun 6 '07 #2
Vidhura
99
Hope the following helps
ContextMenuStrip contextMenuStrip1 = new ContextMenuStrip();
contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
menuItem1ToolStripMenuItem,
menuItem2ToolStripMenuItem,
menuItem3ToolStripMenuItem});


menuStrip1.ContextMenuStrip = contextMenuStrip1;
Jun 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
0
by: steffen_home_92 | last post by:
hi ng, I actually want to program an application whose main window contains a menu strip and a tree view control. In the main menu there are items I want to use for a context menu strip in the...
2
by: Lucky | last post by:
hi guys, i'm working on the context menu for the controls. the problem i'm facing right now is like this : i want to use one context menu for more then one controls lets say i want to use one...
2
by: Ron M. Newman | last post by:
Hi, Just need a little advice. Id like to build *dynamic* context menus for tree nodes. I'm pretty versed in building context menus and attaching them to tree nodes. My question is, what...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
1
by: Louis-Pierre Dauphinais | last post by:
To get the control that called a context menu item (ToolStripMenuItem), I normally do: itm.Owner.SoucreControl but what if the menu item is actually in a second level of the context menu? I...
2
by: Bry | last post by:
I have a context menu which is shared between a TreeView and ListView control (both controls show the same information, similar to how Windows Explorer works, so it makes sense to use the same menu...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
1
by: Phill W. | last post by:
What's the "proper" way of handling this? I have a base Control that offers a small set of options via its ContextMenu. I've now inherited from this and would like to add additional items to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.