ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / ToolBar Tasks / Docking a Toolbar Programmatically
In This Topic
    Docking a Toolbar Programmatically
    In This Topic

    To make a C1ToolBar dockable by using the C1CommandDock class, complete the following steps:

    Note: This topic assumes you have a C1ToolBar created in code.
    1. Create a new C1CommandDock and call it dock.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Dim dock As New C1CommandDock()
      

      To write code in C#

      C#
      Copy Code
      C1CommandDock dock = new C1ComandDock();
      
    2. Add the C1CommandDock to your control so it will appear on the form.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.Controls.Add(dock)
      

      To write code in C#

      C#
      Copy Code
      this.Controls.Add(dock);
      
    See Also