Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MenuStrip DowpDown Issues

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
GB
Good Morning!

I'm having issue coding a MenuStrip to have drop down items and need some advise please!

Within my Form, I have an item MenuStrip1. Within MenuStrip1, I have a collection, Sub1 to Sub10 which I populate programatically depending on a User's Login, this works perfectly!

However, what I need to achieve, is to populate a drop down list from Sub1 to Sub10, again programatically, based on the same User's Login!

Can anyone offer me the solution I need?

Many thanks

Steve
 
Loop through the items in the collection and add an item to the DropDownList for each item in the collection, something like this:

For Each sMenuItem As String In colMenuItems
DropDownList.Items.Add(New ListItem(sMenuItem))​
Next

Note that this assumes the Items in your Collection are Strings; use the correct Type for what you are storing in your Collection.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top