well you would get the list of files from a specified folder:
dim theFiles as String() = System.IO.Directory.GetFiles(theFolder)
then to display the list of files found in a menu item, you would go through each file in theFiles and add a new menu item
| |
Dim theMainMenu as New MainMenu() for each currentFile as String in theFiles theMainMenu.MenuItems.Add(currentFile, new System.EventHandler(AddressOf MenuItem_OnClick) next Me.Menu = theMainMenu private sub MenuItem_OnClick(ByVal sender as System.Object, ByVal e as System.EventArgs) MessageBox.Show(sender.ToString()) end sub
|
you may also wish to add an Onclick event handler, this is the second parameter in the Add() method of the MenuItems collection
does this help
|