DotNetWebTutor.com                                                    Link to Us

Toolbars
Toolbars give you buttons at the top of your window
Clicking a button can be set to trigger a menu item

  • Add a toolstrip control to your form
  • Select the dropdown arrow and select button

button toolbar visual basic
If you add the toolbar after the menu it will be put above it.
Right click the toolbar and choose Bring to Front to move it down below the menu
to get menu above toolbar in visual basic

  • Click the first button and select the image property
  • Choose Project resource file
  • Click Import

import project resources

  • Browse to your project and choose all files
  • Select your icon file
  • Click OK

icon on toolbar in vb

  • Double click the button to add code to the click event
  • Add this code:

Me.BackColor = Color.Red
It is actually better to use the code in your menu
This way you do not have to repeat code for the menu and the toolbar
If you had a menu item named RedToolStripMenuItem you can use this
code:
RedToolStripMenuItem.PerformClick()
toolbars in visual basic