Reader Level:

Adding Images to ToolBar Button

By Mahesh Chand on January 29, 2000
An article shows you how to add images and tooltips to the toolbar buttons.
  • 0
  • 0
  • 16722

The ImageList class and ToolBarButton's ImageIndex property are used to load images to toolbar buttons.

First you load images to ImageList. You can even add your images to the ImageList at design time by using Propeties of ImageList control.

Add and Remove images by using Add and Remove buttons.

Once images are loaded to the ImageList, you use ToolBarButton class's ImageIndex property to set tollbar button images.

tb1.ImageIndex = 1;
tb2.ImageIndex = 2;
tb3.ImageIndex = 3 ;

Adding ToolTips to the ToolBar Buttons

ToolTipText property of Control class is used to Add ToolTips to ToolBar buttons. If tb1, tb2, tb2 are your ToolBarButton class objects, you can directly call ToolTipText to set tool tip for toolbar buttons.

// adding tooltips to the button
tb2.ToolTipText = tb2.Text ;
tb1.ToolTipText = tb1.Text ;
tb3.ToolTipText = tb3.Text ;

Mahesh Chand

Mahesh Chand is founder of C# Corner. C# Corner founded in 1999 is a FREE member contributions based open platform for developers to solve problems, learn new technology and hang out.  Mahesh has been awar... Read more


Trending up