Click here to Skip to main content
15,921,028 members
Home / Discussions / C#
   

C#

 
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 
Ok I don't understand why you are getting a stack overflow, which is very strange...

What I would suggest then is this:

1. Turn all the items checked states off.
2. Tunr on the senders checked state...

// set all checked states to false
strip1.Checked = false;
strip2.Checked = false;
strip3.Checked = false;
strip4.Checked = false;
strip5.Checked = false;

// set the senders checked state
((ToolStripMenuItem)sender).Checked = true;


As you know have already defined the objects and have their names already you don't need to cycle for them, however its not as elegant as the other solution.

I'm still interested in why you getting the stack overflow, can you debug into the loop and examine ((ToolStripDropDownItem)sender).Owner.Items as this must be going up as it cycles round the loop...

And you are statically creating the items through the designer and not programtically??
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 
GeneralRe: Method in a class Pin
C.CoderCreator23-Aug-10 0:08
C.CoderCreator23-Aug-10 0:08 
GeneralRe: Method in a class Pin
Dave Kreskowiak23-Aug-10 4:06
mveDave Kreskowiak23-Aug-10 4:06 
GeneralRe: Method in a class Pin
Pete O'Hanlon23-Aug-10 4:41
mvePete O'Hanlon23-Aug-10 4:41 
GeneralMessage Closed Pin
23-Aug-10 12:53
_beauw_23-Aug-10 12:53 
GeneralRe: Method in a class Pin
Bernhard Hiller23-Aug-10 19:33
Bernhard Hiller23-Aug-10 19:33 
AnswerRe: Method in a class Pin
Abhinav S23-Aug-10 4:21
Abhinav S23-Aug-10 4:21 
QuestionThe strategy Pattern: a recurring problem Pin
pierpaolo paparo22-Aug-10 22:42
pierpaolo paparo22-Aug-10 22:42 
AnswerRe: The strategy Pattern: a recurring problem Pin
Luc Pattyn23-Aug-10 1:17
sitebuilderLuc Pattyn23-Aug-10 1:17 

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.