Create toolbar
To make the application more friendly interface, you can add in the form of a toolbar. Toolbar described by the System.Windows.Forms.ToolBar class. Form can have multiple toolbars, tool bar contains one or more ToolBarButton class descriptions button, you can insert images in each button or icon, to achieve this objective you need an ImageList control as an image container.
ImageList imageList = new ImageList ();
The first instance of each image file into image object, and then add these images to the ImageList control, Image and Bitmap classes can be found in the System.Drawing namespace.
Image newFileImage = new Bitmap (imageFolder + "newFile.bmp");
Image openFileImage = new Bitmap (imageFolder + "openFile.gif");
Image saveFileImage = new Bitmap (imageFolder + "saveFile.bmp");
Image printImage = new Bitmap (imageFolder + "print.gif");.
...
imageList.Images.Add (newFileImage);
imageList.Images.Add (openFileImage);
imageList.Images.Add (saveFileImage);
imageList.Images.Add (printImage);
Note that you can use the Images collection of the add method to image objects to imagelist control. Now these plans to control, you must assign the ImageList control to the ImageList property of ToolBar.
toolBar.ImageList = imageList;
ImageList control and then assign the tool button images ImageIndex property.
newToolBarButton.ImageIndex = 0;
openToolBarButton.ImageIndex = 1;
saveToolBarButton.ImageIndex = 2;
printToolBarButton.ImageIndex = 3;
The same as menu items, tool buttons must now be added to the toolbar.
toolBar.Buttons.Add (separatorToolBarButton);
toolBar.Buttons.Add (newToolBarButton);
toolBar.Buttons.Add (openToolBarButton);
toolBar.Buttons.Add (saveToolBarButton);
toolBar.Buttons.Add (separatorToolBarButton);
toolBar.Buttons.Add (printToolBarButton);
Finally, tools to be added to the form.
this.Controls.Add (toolBar);
Add status bar
Described by the System.Windows.Forms.StatusBar status bar, which provides customized control the appearance of the property, status bar formed by the StatusBarPanel objects in our template status bar has two nested boards:
StatusBar statusBar = new StatusBar ();
StatusBarPanel statusBarPanel1 = new StatusBarPanel ();
StatusBarPanel statusBarPanel2 = new StatusBarPanel ();
Status bar and status bar on the nesting plate set by the following code:
statusBarPanel1.BorderStyle = StatusBarPanelBorderStyle.Sunken;
statusBarPanel1.Text = "Press F1 for Help";
statusBarPanel1.AutoSize = StatusBarPanelAutoSize.Spring;
statusBarPanel2.BorderStyle = StatusBarPanelBorderStyle.Raised;
statusBarPanel2.ToolTipText = System.DateTime.Now.ToShortTimeString ();
statusBarPanel2.Text = System.DateTime.Today.ToLongDateString ();
statusBarPanel2.AutoSize = StatusBarPanelAutoSize.Contents;
statusBar.ShowPanels = true;
statusBar.Panels.Add (statusBarPanel1);
statusBar.Panels.Add (statusBarPanel2);
Similarly, we need to add the status bar to the form:
this.Controls.Add (statusBar);