?
Solved

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

Posted on 2011-03-08
5
Medium Priority
?
363 Views
Last Modified: 2012-05-11
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 ??
0
Comment
Question by:Parth48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Expert Comment

by:angus_young_acdc
ID: 35068582
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
 

Author Comment

by:Parth48
ID: 35068639
but how can i convert it into toolstripitemcollections ??
0
 

Author Comment

by:Parth48
ID: 35068663
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
 
LVL 23

Accepted Solution

by:
wdosanjos earned 2000 total points
ID: 35071733
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question