ImageList for ToolBar : ToolBar : GUI Windows Form C# Source Code


Custom Search

C# Source Code » GUI Windows Form » ToolBar »

 

ImageList for ToolBar








    
 

using System;
using System.Drawing;
using System.Windows.Forms;
   
class SimpleToolBar: Form
{
     public static void Main()
     {
          Application.Run(new SimpleToolBar());
     }
     public SimpleToolBar()
     {
          Menu = new MainMenu();
          Menu.MenuItems.Add("File");
          Menu.MenuItems.Add("Edit");
          Menu.MenuItems.Add("View");
          Menu.MenuItems.Add("Help");
   
          Bitmap bm = new Bitmap(GetType(),"SimpleToolBar.bmp");
   
          ImageList imglst = new ImageList();
          imglst.Images.AddStrip(bm);
          imglst.TransparentColor = Color.Cyan;
   
          ToolBar tbar = new ToolBar();
          tbar.Parent = this;
          tbar.ImageList = imglst;
          tbar.ShowToolTips = true;
   
          string[] astr = {"New", "Open", "Save", "Print", "Cut", "Copy", "Paste" };
   
          for (int i = 0; i < 7; i++)
          {
               ToolBarButton tbarbtn = new ToolBarButton();
               tbarbtn.ImageIndex = i;
               tbarbtn.ToolTipText = astr[i];
   
               tbar.Buttons.Add(tbarbtn);
          }
     }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo GUI Windows Form
» ToolBar