ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / ToolBar Tasks / Adding an Arbitrary Control to the Toolbar
In This Topic
    Adding an Arbitrary Control to the Toolbar
    In This Topic

    To add an arbitrary control to your toolbar, complete the following steps:

    1. Add the C1CommandDock control to your form.
    2. Place the C1ToolBar control onto the C1CommandDock using a drag-and-drop operation.
    3. Right-click on the C1ToolBar located on your form. Select Edit from the context menu. The Link to Command designer appears. Set the following fields  in the Link to Command designer:
      • Text textbox to Find text:
      • Name to c1CommandControl1
      • Command Type to C1CommandControl
      Press the OK button in the Edit dialog box.
    4. Select the C1CommandControl from the Create a new command list box.
    5. Select c1CommandLink1 from the Properties drop-down list, then set the ButtonLook property to Text . The toolbar button appears as text.
    6. Select the Windows form tab and place the ComboBox control to the right side of the C1ToolBar using a drag-and-drop operation. The combo box appears like the following:
      Combobox on the forms
    7. Select c1CommandControl1 from the Properties drop-down list, then select the Control property, and select comboBox1 from its drop-down list.
    8. Build and run the application. Your toolbar will appear like this at run time:
      Combobox on the forms
    See Also