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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamicly assign menu items to mainmenu

Status
Not open for further replies.

ExtraD

Programmer
Joined
Jul 6, 2005
Messages
41
Location
NL
Hi,



again a question :)



i know how to retrieve file and directory data.

but now i want to transform this into a menu.

someting like this:



----------------- Main

| word | excel |

----------------- Sub

| doc1 | excel1 |

| doc2 | excel2 |

-------| excel3 |

----------



i tryed this code:

' Create instances of global MainMenu and MenuItem objects

mnuCountries = New MainMenu

mnuItemEuropeNations = New MenuItem("Some Nations of E&urope")

mnuItemItaly = New MenuItem("&Italy")

mnuItemGermany = New MenuItem("&Germany")

mnuItemFrance = New MenuItem("&France")



' Add mnuItemEuropeNations to MainMenu component's MenuItem collection

mnuCountries.MenuItems.Add(mnuItemEuropeNations)



' Add submenus to mnuItemEuropeNations

mnuItemEuropeNations.MenuItems.Add(mnuItemItaly)

mnuItemEuropeNations.MenuItems.Add(mnuItemGermany)

mnuItemEuropeNations.MenuItems.Add(mnuItemFrance)



' Make mnuCountries the form's menu

Me.Menu = mnuCountries



but how can i make the "click events"?

because i want to do something when they click on a item.



thanx!
 
Check out this thread thread796-1076288

Maybe this world is another planet’s Hell.
Aldous Huxley

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top