I have a ContextMenuStrip inside a form. This has several items like that:
I also attached the image at the bottom of the post.
For some reason, I want to change all items of the context menu simultaneously. So I wrote this peace of code:
Expand|Select|Wrap|Line Numbers
- int a = 0;
- foreach (ToolStripItem co in contextMenuStrip1.Items)
- {
- co.Text = "Menu" + a.ToString();
- a++;
- }
But what I get is "engl1" and "engl2" menus changed into "menu1" and "menu2" as expected, but "engl11" and "engl12" stayed as they were and didn't change into "menu3" and "menu4" as I wanted to.
So how can I have access to those subitems too?
Thanks!