Solved

ContextMenu Question

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

16 Experts available now in Live!

Get 1:1 Help Now