* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
4.1 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|
| How to: Add Buttons to a ToolBar Control Using the Designer | 03/30/2017 |
|
d9ce3040-3e21-4e2d-80ae-b430982b2db8 |
How to: Add Buttons to a ToolBar Control Using the Designer
Note
The xref:System.Windows.Forms.ToolStrip control replaces and adds functionality to the xref:System.Windows.Forms.ToolBar control; however, the xref:System.Windows.Forms.ToolBar control is retained for both backward compatibility and future use, if you choose.
An integral part of the xref:System.Windows.Forms.ToolBar control is the buttons you add to it. These can be used to provide easy access to menu commands or, alternately, they can be placed in another area of the user interface of your application to expose commands to your users that are not available in the menu structure.
The following procedure requires a Windows Application project with a form containing a xref:System.Windows.Forms.ToolBar control. For information about setting up such a project, see How to: Create a Windows Forms application project and How to: Add Controls to Windows Forms.
To add buttons at design time
-
Select the xref:System.Windows.Forms.ToolBar control.
-
In the Properties window, click the xref:System.Windows.Forms.ToolBar.Buttons%2A property to select it and click the Ellipsis (
) button to open the ToolBarButton Collection Editor. -
Use the Add and Remove buttons to add and remove buttons from the xref:System.Windows.Forms.ToolBar control.
-
Configure the properties of the individual buttons in the Properties window that appears in the pane on the right side of the editor. The following table shows some important properties to consider.
-
Click OK to close the dialog box and create the panels you specified.