In This Article

DockableToolBar Class

Represents a dockable toolbar control.

[TypeConverter(typeof(DockableToolBarConverter))]
public class DockableToolBar : UIElement, IInputElement, IUIElement, ILogicalTreeNode, IDisposable, IBarControl, IBarObject, IDpiAwareElement, IOrientedElement, IHasDefaultCommandLinks
Inheritance:
object MarshalByRefObject DisposableObject LogicalTreeNodeBase UIElement object
Derived:
MenuBar
Implements:
IInputElement IUIElement ILogicalTreeNode IDisposable IBarControl IBarObject IDpiAwareElement IOrientedElement IHasDefaultCommandLinks

Constructors

DockableToolBar(string)

Initializes a new instance of the DockableToolBar class.

public DockableToolBar(string key)
Parameter Type Description
key string

A string-based key that uniquely identifies the toolbar.

Properties

Active

Gets or sets whether the toolbar is active (visible).

public bool Active { get; set; }

Property Value

bool:

true if the toolbar is active (visible); otherwise, false.

ActualDockedRow

Gets the index of the row in which the toolbar is actually docked.

[Browsable(false)]
public int ActualDockedRow { get; }

Property Value

int:

The index of the row in which the toolbar is actually docked, or -1 if not docked or visible.

Remarks

This value provides the actual docked row of the toolbar, as opposed to the DockedRow property, which provides the desired docked row.

AutoShowForMode

Gets or sets whether to auto-show the toolbar if the mode is appropriate.

[Browsable(false)]
public bool AutoShowForMode { get; set; }

Property Value

bool:

true if the toolbar should be made visible or hidden depending on the mode; otherwise, false.

Remarks

This property is auto-updated when the Active property value changes and should not generally be set externally.

BodyBounds

Gets the bounds of the toolbar body area that contains the command links.

[Browsable(false)]
public Rectangle BodyBounds { get; }

Property Value

Rectangle:

The bounds of the toolbar body area that contains the command links.

CanClose

Gets or sets whether the toolbar may be closed.

public DefaultableBoolean CanClose { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be closed.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanCloseResolved

Gets or sets whether the toolbar may be closed by using global and instance settings.

[Browsable(false)]
public bool CanCloseResolved { get; }

Property Value

bool:

true if the toolbar may be closed; otherwise, false.

CanDockHostBottom

Gets or sets whether the toolbar may be docked to the bottom of the host container control.

public DefaultableBoolean CanDockHostBottom { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be docked to the bottom of the host container control.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanDockHostLeft

Gets or sets whether the toolbar may be docked to the left of the host container control.

public DefaultableBoolean CanDockHostLeft { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be docked to the left of the host container control.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanDockHostRight

Gets or sets whether the toolbar may be docked to the right of the host container control.

public DefaultableBoolean CanDockHostRight { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be docked to the right of the host container control.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanDockHostTop

Gets or sets whether the toolbar may be docked to the top of the host container control.

public DefaultableBoolean CanDockHostTop { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be docked to the top of the host container control.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanDrag

Gets or sets whether the toolbar may be dragged to another location.

public DefaultableBoolean CanDrag { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be dragged to another location.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

CanFloat

Gets or sets whether the toolbar may be contained in a floating window.

public DefaultableBoolean CanFloat { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the toolbar may be contained in a floating window.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting.

Gets the BarCommandLinkCollection containing the command links for use in the control.

[Browsable(false)]
public BarCommandLinkCollection CommandLinks { get; }

Property Value

BarCommandLinkCollection:

The BarCommandLinkCollection containing the command links for use in the control.

CreationStyle

Gets or sets the creation style of the toolbar.

public DockableToolBarCreationStyle CreationStyle { get; set; }

Property Value

DockableToolBarCreationStyle:

A DockableToolBarCreationStyle indicating the creation style of the toolbar.

Remarks

Non-custom toolbars may not be renamed or deleted by the end-user.

Gets the BarCommandLinkCollection containing the default command links used when resetting the toolbar.

[Browsable(false)]
public BarCommandLinkCollection DefaultCommandLinks { get; }

Property Value

BarCommandLinkCollection:

The BarCommandLinkCollection containing the default command links used when resetting the toolbar.

DockedColumn

Gets or sets the index of the column in which the toolbar should be docked within the current row.

public int DockedColumn { get; set; }

Property Value

int:

The index of the column in which the toolbar should be docked within the current row.

DockedRow

Gets or sets the index of the row in which the toolbar should be docked.

public int DockedRow { get; set; }

Property Value

int:

The index of the row in which the toolbar should be docked.

FloatingLocation

Gets or sets the Point at which the toolbar is located when floating.

public Point FloatingLocation { get; set; }

Property Value

Point:

The Point at which the toolbar is located when floating.

HasOptionsButton

Gets or sets whether the toolbar has an options button.

public virtual DefaultableBoolean HasOptionsButton { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean indicating whether the toolbar has an options button.

Remarks

If set to DefaultableBoolean.Default, the resolved value will use the global ActiproSoftware.UI.WinForms.Controls.Bars.DockableToolBar.BarManager setting. If this value resolves to true then the toolbar will display an options button.

Gets whether the toolbar has overflowed command links.

[Browsable(false)]
public bool HasOverflowedCommandLinks { get; }

Property Value

bool:

true if the toolbar has overflowed command links; otherwise, false.

Key

Gets or sets a string-based key that uniquely identifies the toolbar.

public string Key { get; set; }

Property Value

string:

A string-based key that uniquely identifies the toolbar.

Modes

Gets a BarModeCollection containing the names of the modes in which the toolbar is automatically made visible or hidden.

public BarModeCollection Modes { get; }

Property Value

BarModeCollection:

A BarModeCollection containing the names of the modes in which the toolbar is automatically made visible or hidden.

Orientation

Gets the orientation of the toolbar.

[Browsable(false)]
public Orientation Orientation { get; }

Property Value

Orientation:

A Orientation that specifies the orientation.

Position

Gets or sets the DockableToolBarPosition that indicates the position of the toolbar.

public DockableToolBarPosition Position { get; set; }

Property Value

DockableToolBarPosition:

The DockableToolBarPosition that indicates the position of the toolbar.

RendererResolved

Gets the IBarRenderer used to render the control.

[Browsable(false)]
public IBarRenderer RendererResolved { get; }

Property Value

IBarRenderer:

The IBarRenderer used to render the control.

Remarks

This property will return a global renderer if there is no control instance renderer override.

RequiresFullRow

Gets or sets whether the toolbar requires a full row in the layout.

public virtual bool RequiresFullRow { get; set; }

Property Value

bool:

true if the toolbar requires a full row in the layout; otherwise, false.

ScreenBounds

Gets the screen bounds of the control.

[Browsable(false)]
public Rectangle ScreenBounds { get; }

Property Value

Rectangle:

A Rectangle specifying the screen bounds of the control.

Text

Gets or sets the text of the toolbar that is displayed in the user interface, if it should be different than the value of the Key property.

public string Text { get; set; }

Property Value

string:

The text of the toolbar that is displayed in the user interface.

Remarks

If this value is null, the value of the Key property will be used for the user interface.

TitleBarText

Gets the text of the toolbar that is displayed in floating toolbar captions and customize dialogs.

[Browsable(false)]
public string TitleBarText { get; }

Property Value

string:

The text of the toolbar that is displayed in floating toolbar captions and customize dialogs.

Remarks

This property returns the value of the Text property if it is not null. Otherwise, the value of the Key property is returned.

Methods

ArrangeOverride(Size)

Positions child elements and determines an arrange size.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

Remarks

Element authors should override this method, call Arrange on each visible child element and position each child element. It is required that a parent element calls Arrange on each child or they won't be rendered.

CreateChildren()

Invoked when the collection of child elements is to be created.

protected override IList CreateChildren()

Returns

IList:

The IList that should be assigned to the Children property.

Remarks

By default no child collection is created.

Dispose(bool)

Disposes any resources used by the object.

protected override void Dispose(bool disposing)
Parameter Type Description
disposing bool

Whether the object is being disposed.

DockTo(DockableToolBarPosition, int, int, bool)

Activates and docks the toolbar to the specified location.

public void DockTo(DockableToolBarPosition position, int dockedRow, int dockedColumn, bool requiresNewRow)
Parameter Type Description
position DockableToolBarPosition

The DockableToolBarPosition that indicates the dock position of the toolbar.

dockedRow int

The index of the row in which the toolbar should be docked.

dockedColumn int

The index of the column in which the toolbar should be docked within the row.

requiresNewRow bool

Whether the docking requires a new row. Even if false, other conditions may insert the toolbar in a new row anyhow.

MeasureOverride(Graphics, Size)

Measures the size in layout required for child elements and determines a size for the element itself.

protected override Size MeasureOverride(Graphics g, Size availableSize)
Parameter Type Description
g Graphics

The Graphics object to use for measurement.

availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

Remarks

Element authors should override this method, call Measure on each visible child element and determine the total size required.

OnMouseDown(MouseEventArgs)

Raises the MouseDown event.

protected override void OnMouseDown(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnMouseMove(MouseEventArgs)

Raises the MouseMove event.

protected override void OnMouseMove(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnParentChanged()

Invoked when logical parent is changed. This is invoked after the parent has changed, and the purpose is to allow elements to perform actions based on the changed parent.

protected override void OnParentChanged()

OnRender(PaintEventArgs)

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

A PaintEventArgs that contains the event data.

OnRenderChildElements(PaintEventArgs)

Renders the child elements.

protected override void OnRenderChildElements(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

A PaintEventArgs that contains the event data.

Remarks

This method should not generally be overridden. The default implementation of this method calls the Render(PaintEventArgs) method on all child elements.

ReadAttributesFromXml(BarLayoutXmlSerializer)

Deserializes the attribute data for the DockableToolBar from XML.

protected virtual void ReadAttributesFromXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

ReadElementFromXml(BarLayoutXmlSerializer)

Deserializes a child element for the BarCommandLink from XML.

protected virtual void ReadElementFromXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

Redock()

Redocks the toolbar in its last docked position.

public void Redock()

Reset()

Resets the command links on the toolbar to the set of command links in the DefaultCommandLinks.

public virtual void Reset()

ResetActive()

Resets the Active property to its default value.

public virtual void ResetActive()

ResetCanClose()

Resets the CanClose property to its default value.

public virtual void ResetCanClose()

ResetCanDockHostBottom()

Resets the CanDockHostBottom property to its default value.

public virtual void ResetCanDockHostBottom()

ResetCanDockHostLeft()

Resets the CanDockHostLeft property to its default value.

public virtual void ResetCanDockHostLeft()

ResetCanDockHostRight()

Resets the CanDockHostRight property to its default value.

public virtual void ResetCanDockHostRight()

ResetCanDockHostTop()

Resets the CanDockHostTop property to its default value.

public virtual void ResetCanDockHostTop()

ResetCanDrag()

Resets the CanDrag property to its default value.

public virtual void ResetCanDrag()

ResetCanFloat()

Resets the CanFloat property to its default value.

public virtual void ResetCanFloat()

ResetCreationStyle()

Resets the CreationStyle property to its default value.

public virtual void ResetCreationStyle()

ResetDockedColumn()

Resets the DockedColumn property to its default value.

public virtual void ResetDockedColumn()

ResetDockedRow()

Resets the DockedRow property to its default value.

public virtual void ResetDockedRow()

ResetFloatingLocation()

Resets the FloatingLocation property to its default value.

public virtual void ResetFloatingLocation()

ResetHasOptionsButton()

Resets the HasOptionsButton property to its default value.

public virtual void ResetHasOptionsButton()

ResetPosition()

Resets the Position property to its default value.

public virtual void ResetPosition()

ResetRequiresFullRow()

Resets the RequiresFullRow property to its default value.

public virtual void ResetRequiresFullRow()

ResetText()

Resets the Text property to its default value.

public virtual void ResetText()

ShouldSerializeActive()

Indicates whether the Active property should be persisted.

public virtual bool ShouldSerializeActive()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanClose()

Indicates whether the CanClose property should be persisted.

public virtual bool ShouldSerializeCanClose()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanDockHostBottom()

Indicates whether the CanDockHostBottom property should be persisted.

public virtual bool ShouldSerializeCanDockHostBottom()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanDockHostLeft()

Indicates whether the CanDockHostLeft property should be persisted.

public virtual bool ShouldSerializeCanDockHostLeft()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanDockHostRight()

Indicates whether the CanDockHostRight property should be persisted.

public virtual bool ShouldSerializeCanDockHostRight()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanDockHostTop()

Indicates whether the CanDockHostTop property should be persisted.

public virtual bool ShouldSerializeCanDockHostTop()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanDrag()

Indicates whether the CanDrag property should be persisted.

public virtual bool ShouldSerializeCanDrag()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCanFloat()

Indicates whether the CanFloat property should be persisted.

public virtual bool ShouldSerializeCanFloat()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCreationStyle()

Indicates whether the CreationStyle property should be persisted.

public virtual bool ShouldSerializeCreationStyle()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeDockedColumn()

Indicates whether the DockedColumn property should be persisted.

public virtual bool ShouldSerializeDockedColumn()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeDockedRow()

Indicates whether the DockedRow property should be persisted.

public virtual bool ShouldSerializeDockedRow()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeFloatingLocation()

Indicates whether the FloatingLocation property should be persisted.

public virtual bool ShouldSerializeFloatingLocation()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeHasOptionsButton()

Indicates whether the HasOptionsButton property should be persisted.

public virtual bool ShouldSerializeHasOptionsButton()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializePosition()

Indicates whether the Position property should be persisted.

public virtual bool ShouldSerializePosition()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeRequiresFullRow()

Indicates whether the RequiresFullRow property should be persisted.

public virtual bool ShouldSerializeRequiresFullRow()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeText()

Indicates whether the Text property should be persisted.

public virtual bool ShouldSerializeText()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Undock()

Undocks and floats the toolbar.

public void Undock()

WriteAttributesToXml(BarLayoutXmlSerializer)

Serializes the attribute data for the BarCommand to XML.

protected virtual void WriteAttributesToXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

WriteElementsToXml(BarLayoutXmlSerializer)

Serializes the child element data for the BarCommand to XML.

protected virtual void WriteElementsToXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

Inherited Members