Click here to Skip to main content
15,920,801 members
Home / Discussions / C#
   

C#

 
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 
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 
ok, the only reason that you'd be getting a stack overflow from this loop is if new menu items were being added to the context menu strip, so in effect you'd be getting an ever increasing list.

That's something to check also to make sure that during each iterration of the loop that the count list count doesn't change.

As I said the example snippet I have here doesn't exhibit that issue....


Aslo as I mentioned earlier you can directly access the menu items and context menu required without looping round, for example:

// accessing the menu items directly


myToolstripMenuItem1.Checked = true;
myToolstripMenuItem2.Checked = false;
myToolstripMenuItem3.Checked = false;



// accessing the ContextMenuStrip directly

foreach (ToolStripMenuItem item in myContextMenuStrip.Items)
{

.......

}


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

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 
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 

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.