Solved

ContextMenu Question

Posted on 2006-11-26
2
445 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
[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 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

Technology Partners: 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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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