Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerPRE-less cross-post alert Pin
Luc Pattyn23-Aug-10 1:32
sitebuilderLuc Pattyn23-Aug-10 1:32 
QuestionC# Talking To All The ContextMenuStrip's Pin
C.CoderCreator23-Aug-10 0:03
C.CoderCreator23-Aug-10 0:03 
AnswerRe: C# Talking To All The ContextMenuStrip's Pin
Mycroft Holmes23-Aug-10 0:45
professionalMycroft Holmes23-Aug-10 0:45 
AnswerRe: C# Talking To All The ContextMenuStrip's Pin
Rhuros23-Aug-10 1:26
professionalRhuros23-Aug-10 1:26 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator23-Aug-10 22:33
C.CoderCreator23-Aug-10 22:33 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
Rhuros23-Aug-10 23:16
professionalRhuros23-Aug-10 23:16 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator24-Aug-10 0:05
C.CoderCreator24-Aug-10 0:05 
AnswerRe: C# Talking To All The ContextMenuStrip's [modified] Pin
Rhuros24-Aug-10 0:50
professionalRhuros24-Aug-10 0:50 
No a better approach would be to:

foreach (ToolStripItem item in ((ToolStripDropDownItem)sender).Owner.Items)
{
    if (item.GetType() == typeof(ToolStripMenuItem))
    {
        if (item == sender)
            ((ToolStripMenuItem)item).Checked = true;
        else
            ((ToolStripMenuItem)item).Checked = false;
    }
}


testing for the items type before you set teh check state of an item.

modified on Tuesday, August 24, 2010 8:41 AM

GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator24-Aug-10 0:55
C.CoderCreator24-Aug-10 0:55 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
Rhuros24-Aug-10 1:07
professionalRhuros24-Aug-10 1:07 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator24-Aug-10 1:11
C.CoderCreator24-Aug-10 1:11 
AnswerRe: C# Talking To All The ContextMenuStrip's [modified] Pin
Rhuros24-Aug-10 1:24
professionalRhuros24-Aug-10 1:24 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator24-Aug-10 22:05
C.CoderCreator24-Aug-10 22:05 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
Rhuros25-Aug-10 1:08
professionalRhuros25-Aug-10 1:08 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
C.CoderCreator25-Aug-10 19:55
C.CoderCreator25-Aug-10 19:55 
AnswerRe: C# Talking To All The ContextMenuStrip's Pin
Rhuros25-Aug-10 23:11
professionalRhuros25-Aug-10 23:11 
GeneralRe: C# Talking To All The ContextMenuStrip's Pin
johannesnestler24-Aug-10 5:03
johannesnestler24-Aug-10 5:03 
QuestionEmail Opening and Attachment Download Tracking Pin
Pratik Vasant Shah22-Aug-10 23:34
Pratik Vasant Shah22-Aug-10 23:34 
AnswerRe: Email Opening and Attachment Download Tracking Pin
ScottM123-Aug-10 1:20
ScottM123-Aug-10 1:20 
JokeRe: Email Opening and Attachment Download Tracking Pin
Calla23-Aug-10 2:01
Calla23-Aug-10 2:01 
GeneralRe: Email Opening and Attachment Download Tracking Pin
Gregory Gadow23-Aug-10 4:53
Gregory Gadow23-Aug-10 4:53 
QuestionMethod in a class Pin
Enobong Adahada22-Aug-10 23:09
Enobong Adahada22-Aug-10 23:09 
AnswerMessage Closed Pin
22-Aug-10 23:13
stancrm22-Aug-10 23:13 
GeneralRe: Method in a class Pin
Enobong Adahada22-Aug-10 23:17
Enobong Adahada22-Aug-10 23:17 
GeneralMessage Closed Pin
22-Aug-10 23:36
stancrm22-Aug-10 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.