how can i convert it in C#.net window application ??

currently i am creating dynamic menu in my application , for this i want to convert list of toolstripmenuitem into toolstripitemcollections , but how can i do this ??

please refer the below code ..
List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>();

Open in new window


now i want to convert above list of toolstripmenuitem in to toolstripitemcollections , but how can i do this ??
Parth48Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
wdosanjosConnect With a Mentor Commented:
It should be something like this:

List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>();
ToolStrip yourToolStrip = new ToolStrip();

//  ... your code to add ToolStripMenuItem's

ToolStripItemCollection stripCol = new ToolStripItemCollection(yourToolStrip, menuItems.ToArray());

// Or, if the ToolStripItemCollection is already created
stripCol.AddRange(menuItems.ToArray());

Open in new window

0
 
angus_young_acdcCommented:
Not sure I follow what it is you are after, can you explain in some more detail please about what you hope to achieve?
0
 
Parth48Author Commented:
but how can i convert it into toolstripitemcollections ??
0
 
Parth48Author Commented:
it's actually needed when u add items to the menustrip ...

please refer the below code ...

MenuStrip menuItems = new MenuStrip();

menuitems.Items.AddRange(toolstripitemcollections);

Open in new window


referring above code i have to need toolstripitemcollections class ...

what can i do now ??
0
All Courses

From novice to tech pro — start learning today.