Represents a toolbar-like control with flat appearance and support for custom drop-down controls. It provides all the functionality of the standard Windows.Forms.ToolBar as well as moving and changing location. This toolbar also provides some extended features as dropping custom PopupWindow objects instead of the standard ContextMenus.
The following example demostrates how to add a combobox to an existing
ToolBar object:
This is useful because if you add the control directly to the toolbar
you will be responsible for its proper location and size, while assigning it
to a toolbar button guaranties you that.
'create a toolbar
Dim toolbar As ToolBar = New ToolBar()
'create a toolbar button
Dim tbb As ToolBarButton = New ToolBarButton()
tbb.Style = ToolBarButtonStyle.Control
'create a standard combobox
Dim combo As ComboBox = New ComboBox()
'assign it to the toolbar button
tbb.Control = combo
toolbar.Buttons.Add(tbb)
//create a toolbar
ToolBar toolbar = new ToolBar();
//create a toolbar button
ToolBarButton tbb = new ToolBarButton();
tbb.Style = ToolBarButtonStyle.Control;
//create a standard combobox
ComboBox combo = new ComboBox();
//assign it to the toolbar button
tbb.Control = combo;
toolbar.Buttons.Add(tbb);
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2