Click here to Skip to main content
15,927,344 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to use FolderBrowserDialog? Pin
Joshua Quick14-Jan-06 9:23
Joshua Quick14-Jan-06 9:23 
GeneralRe: How to use FolderBrowserDialog? Pin
Zenly14-Jan-06 11:31
Zenly14-Jan-06 11:31 
AnswerRe: How to use FolderBrowserDialog? Pin
Dave Kreskowiak14-Jan-06 15:42
mveDave Kreskowiak14-Jan-06 15:42 
GeneralRe: How to use FolderBrowserDialog? Pin
Zenly21-Jan-06 18:53
Zenly21-Jan-06 18:53 
QuestionMagic Library Menu Control-Help Pin
bgc-waterman14-Jan-06 8:38
bgc-waterman14-Jan-06 8:38 
AnswerRe: Magic Library Menu Control-Help Pin
Robert Rohde14-Jan-06 22:06
Robert Rohde14-Jan-06 22:06 
QuestionRe: Magic Library Menu Control-Help Pin
bgc-waterman16-Jan-06 1:33
bgc-waterman16-Jan-06 1:33 
AnswerRe: Magic Library Menu Control-Help Pin
Robert Rohde16-Jan-06 6:46
Robert Rohde16-Jan-06 6:46 
I also had the experience that the designer support of it is really bad. You have to code this by hand. Hopefully this little example brings you on the right track:
Assuming you have a Menu Control named _menuMain:
C#
MenuCommand topLevelCommand = new MenuCommand();
topLevelCommand.Text = "Top1";
_menuMain.MenuCommands.Add(topLevelCommand);

MenuCommand subLevelCommand1 = new MenuCommand();
subLevelCommand1.Text = "Sub1";
subLevelCommand1.Click += new EventHandler(subLevelCommand1_Click);
topLevelCommand.MenuCommands.Add(subLevelCommand1);

MenuCommand subLevelCommand2 = new MenuCommand();
subLevelCommand2.Text = "Sub2";
subLevelCommand2.Click += new EventHandler(subLevelCommand2_Click);
topLevelCommand.MenuCommands.Add(subLevelCommand2);

Surely you can set some more properties on every MenuCommand like Image (or ImageList and ImageIndex) or Shortcut. To add colors use the Extra... properties of the MenuCommands property.
You should also consider binding the Click events to a single method which then decides which operation to do:
C#
public void MenuCommand_Click(object sender, EventArgs e){
   if (sender == subLevelCommand1) {
      //perform operation 1
   } else if (sender == subLevelCommand2) {
      //perform operation 2
   }
}



-- modified at 12:46 Monday 16th January, 2006
I just noticed I've written the example in C#. Are you able to translate it yourself? If not I'll repost a VB.Net version Smile | :)
GeneralRe: Magic Library Menu Control-Help Pin
bgc-waterman16-Jan-06 10:08
bgc-waterman16-Jan-06 10:08 
GeneralRe: Magic Library Menu Control-Help Pin
bgc-waterman16-Jan-06 16:04
bgc-waterman16-Jan-06 16:04 
GeneralRe: Magic Library Menu Control-Help Pin
Robert Rohde16-Jan-06 20:32
Robert Rohde16-Jan-06 20:32 
GeneralRe: Magic Library Menu Control-Help Pin
bgc-waterman17-Jan-06 16:28
bgc-waterman17-Jan-06 16:28 
GeneralRe: Magic Library Menu Control-Help Pin
Robert Rohde17-Jan-06 19:53
Robert Rohde17-Jan-06 19:53 
QuestionRemove the back slash in a TextBox Pin
Bob Zagars14-Jan-06 8:18
Bob Zagars14-Jan-06 8:18 
AnswerRe: Remove the back slash in a TextBox Pin
Joshua Quick14-Jan-06 8:40
Joshua Quick14-Jan-06 8:40 
GeneralRe: Remove the (Forward) slash in a TextBox Pin
Bob Zagars14-Jan-06 8:46
Bob Zagars14-Jan-06 8:46 
GeneralRe: Remove the (Forward) slash in a TextBox Pin
Joshua Quick14-Jan-06 9:00
Joshua Quick14-Jan-06 9:00 
GeneralRe: Remove the (back) slash in a TextBox Pin
Bob Zagars14-Jan-06 10:38
Bob Zagars14-Jan-06 10:38 
AnswerRe: Remove the back slash in a TextBox Pin
Joshua Quick14-Jan-06 11:07
Joshua Quick14-Jan-06 11:07 
GeneralRe: Remove the back slash in a TextBox Pin
Bob Zagars14-Jan-06 11:28
Bob Zagars14-Jan-06 11:28 
GeneralRe: Remove the back slash in a TextBox Pin
Joshua Quick14-Jan-06 12:22
Joshua Quick14-Jan-06 12:22 
GeneralRe: Remove the back slash in a TextBox Pin
Bob Zagars14-Jan-06 12:38
Bob Zagars14-Jan-06 12:38 
GeneralRe: Remove the back slash in a TextBox Pin
Joshua Quick14-Jan-06 12:58
Joshua Quick14-Jan-06 12:58 
GeneralRe: Remove the back slash in a TextBox Pin
Bob Zagars14-Jan-06 13:14
Bob Zagars14-Jan-06 13:14 
GeneralRe: Remove the back slash in a TextBox Pin
Bob Zagars14-Jan-06 11:40
Bob Zagars14-Jan-06 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.