ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars Overview / Toolbars Appearance and Behavior / Toolbar and Button Layout Behavior
In This Topic
    Toolbar and Button Layout Behavior
    In This Topic

    C1ToolBars layout is very flexible. They can be horizontal or vertical as well as docked to specific areas of the form. The toolbar's Movable property is enabled by default. This allows the user to move the toolbar anywhere on the form. The default layout for a toolbar is horizontal. You can change the toolbar layout to vertical by setting the Horizontal to False.

    Note: When you set the ToolBarStyle property to DropDownMenu, the menu behaves like a drop-down so the toolbar becomes stationary.

    In addition to toolbar orientation, C1ToolBar also provides button alignment for vertical toolbars. You can align the image or text near, center, or far from the button through the ButtonAlign property.

    The following table shows the values for the ButtonAlign property:

    Property Setting Image
    ButtonAlign.Near Near button alignment
    ButtonAlign.Center Centre button alignment
    ButtonAlign.Far Far button alignment

    You can determine the relative position of text and images for toolbar buttons in horizontal and vertical toolbars using the ButtonLayoutHorz and ButtonLayoutVert properties. The ButtonLayoutHorz property gets the layout of the buttons when the toolbar is horizontal. This is the default orientation of the toolbar. The ButtonLayoutVert property gets the layout of the buttons when the toolbar is vertical. Setting the Horizontal property to False gets the vertical orientation for the toolbar.

    Note: The default value for the ButtonLayoutHorz property is TextOnRight.

    C1ToolBar provides several options for customizing the toolbar buttons for vertical and horizontal toolbars.

    Property Setting Image
    ButtonLayoutHorz.TextOnRight (default) Text on Right
    ButtonLayoutHorz.TextOnLeft Text on Left
    ButtonLayoutHorz.TextAbove Text above
    ButtonLayoutHorz.TextBelow Text below

    In addition to controlling the relative position of text and images for toolbar buttons you can also set the ButtonLookHorz property to display text, images, or both for the horizontal toolbar and the ButtonLookVert property to display text, images, or both for the vertical toolbar.

    Note: The Text, Image, and TextAndImage values for the ButtonLook property overrides the values for the ButtonLookHorz and ButtonLookVert properties. The ButtonLook property should be set to default if you plan on setting values for the ButtonLookHorz or ButtonLookVert property.

    The following table shows the values for the ButtonLayoutVert property:

    Property Setting Image
    ButtonLayoutVert.TextOnRight Right button layout
    ButtonLayoutVert.TextOnLeft Left button layout
    ButtonLayoutVert.TextAbove Above button layout
    ButtonLayoutVert.TextBelow (default) below above layout
    See Also