Solved

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

Posted on 2011-03-08
5
342 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
5 Comments
 
LVL 15

Expert Comment

by:angus_young_acdc
Comment Utility
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
 
LVL 5

Expert Comment

by:mayankagarwal
Comment Utility
0
 

Author Comment

by:Parth48
Comment Utility
but how can i convert it into toolstripitemcollections ??
0
 

Author Comment

by:Parth48
Comment Utility
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 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now