Combining toolbar and Main menu commands

No, you'll have to call one from the other. This is unfortunate, and many third-party controls for drawing "nice" toolbars and menus operate this way, but not the tools that are provided by default.
 
So if I understand you correctly...

If I want to show an about screen from the main menu and program a show dialog to display it, then I also have to program the same show dialog from the toolbar menu? The two menu commands cannot be connected so the I only need to program the show dialog once?
 
Or you can create a sub for the code you want to execute and then in both of the events for the menu and the toolbar, have it call the sub...

IE:
Visual Basic:
  Private Sub RunMyCode()

  End Sub

  Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
    RunMyCode()
  End Sub

  Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
    RunMyCode()
  End Sub
 
Back
Top