Solved

ContextMenu Question

Posted on 2006-11-26
2
444 Views
Last Modified: 2012-08-14
Hi
   
How can i find/get the tag value from the menuitem that is clicked

  private void contextMenu_Click(object sender,ContextMenuStrip e, ContextMenu.MenuItemCollection e)
        {

            ContextMenuStrip.ItemClicked(e.tag.value);


            cmd = int.Parse(e.Tag.ToString());
            //Evaluer i switchen
            Toolbarcmd(cmd);
        }
0
Comment
Question by:vbturbo
2 Comments
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 250 total points
ID: 18015745
Hi, you need to handle the ItemClicked event not the Click event, e.g.

private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
            string tag = e.ClickedItem.Tag.ToString();
}
0
 
LVL 18

Author Comment

by:vbturbo
ID: 18017494
Thanks Zephyr
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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