ComponentOne ToolBar for ASP.NET AJAX: ToolBar Behavior > Docking and Floating Toolbars

Docking and Floating Toolbars

Toolbars can be docked to the top, left, right or bottom on the container that the C1ToolBarContainer has been assigned to.

Each C1ToolBar resides inside the docking area when it is docked. Toolbars can be moved to different docking areas by using a drag-and-drop operation when the AllowDrag property is set to True. C1ToolBar can also be resized.

Use the Dock property to define how a toolbar is automatically resized as its parent control is resized. For example, setting dock to Left causes the toolbar to align itself with the left edges of its parent control and to resize as the parent control is resized.

A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container.

When a toolbar is docked to an edge of its parent control, it is always positioned flush against that edge when the container is resized. If more than one toolbar is docked to an edge, the controls appear side by side according to their z-order; controls higher in the z-order are positioned farther from the container's edge.

If Left, Right, Top, or Bottom is selected, the specified and opposite edges of the control are resized to the size of the containing control's corresponding edges. If Fill is selected, all four sides of the control are resized to match the containing control's edges.

The following table describes the settings for each value in the Dock property.

 

Value

Constant

Description

0

None

The control is not docked.

1

Top

The control’s top edge is docked to the top of its containing control.

2

Bottom

The control’s bottom edge is docked to the bottom of its containing control.

3

Left

The control’s left edge is docked to the left edge of its containing control.

4

Right

The control’s right edge is docked to the right edge of its containing control.

5

Fill

All the control’s edges are docked to the all edges of its containing control and sized appropriately.

 

Use the DockMode property to define the docking behavior of a toolbar control. By default, if the control is dragged over a C1ToolBarContainer control and the mouse is released, then the control will be docked to the left edge of the C1ToolBarContainer. If the control isn’t over the C1ToolBarContainer control and the mouse is released, then the control will float. If the property is DockMode.Docked and the control is dragged over a C1ToolBarContainer control, then if we release the mouse, the toolbar control will be docked to the left edge of the C1ToolBarContainer. Otherwise, the toolbar control will still float on the C1ToolBarContainer.

The following table describes the settings for each value in the DockMode property:

 

Value

Constant

Description

0

ByDefault

The control is able to be both docked and undocked.

1

Docked

The control will be docked when the control is over the dockable zone.

2

Floating

The toolbar control can float.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.