In This Article

MenuBar Class

Represents a menubar.

public class MenuBar : DockableToolBar, IInputElement, IUIElement, ILogicalTreeNode, IDisposable, IHasDefaultCommandLinks, IBarControl, IBarObject
Inheritance:
Object MarshalByRefObject DisposableObject LogicalTreeNodeBase UIElement DockableToolBar Object
Implements:
IInputElement IUIElement ILogicalTreeNode IDisposable IHasDefaultCommandLinks IBarControl IBarObject

Constructors

MenuBar(String)

Initializes a new instance of the MenuBar class.

public MenuBar(string key)
Parameter Type Description
key String

A string-based key that uniquely identifies the toolbar.

Properties

HasMaximizedMdiChildForm

Gets whether there is a maximized MDI child form that needs information displayed on the menu bar.

public bool HasMaximizedMdiChildForm { get; }

Property Value

Boolean:

true if there is a maximized MDI child form; otherwise, false.

HasOptionsButton

Gets or sets whether the toolbar has an options button.

public override 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 BarManager setting. If this value resolves to true then the toolbar will display an options button.

RequiresFullRow

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

public override bool RequiresFullRow { get; set; }

Property Value

Boolean:

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

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.

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.

ResetCanClose()

Resets the CanClose property to its default value.

public override void ResetCanClose()

ResetCanDrag()

Resets the CanDrag property to its default value.

public override void ResetCanDrag()

ResetDockedRow()

Resets the DockedRow property to its default value.

public override void ResetDockedRow()

ResetHasOptionsButton()

Resets the HasOptionsButton property to its default value.

public override void ResetHasOptionsButton()

ResetRequiresFullRow()

Resets the RequiresFullRow property to its default value.

public override void ResetRequiresFullRow()

ShouldSerializeCanClose()

Indicates whether the CanClose property should be persisted.

public override bool ShouldSerializeCanClose()

Returns

Boolean:

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

ShouldSerializeCanDrag()

Indicates whether the CanDrag property should be persisted.

public override bool ShouldSerializeCanDrag()

Returns

Boolean:

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

ShouldSerializeDockedRow()

Indicates whether the DockedRow property should be persisted.

public override bool ShouldSerializeDockedRow()

Returns

Boolean:

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

ShouldSerializeHasOptionsButton()

Indicates whether the HasOptionsButton property should be persisted.

public override bool ShouldSerializeHasOptionsButton()

Returns

Boolean:

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

ShouldSerializeRequiresFullRow()

Indicates whether the RequiresFullRow property should be persisted.

public override bool ShouldSerializeRequiresFullRow()

Returns

Boolean:

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

Explicit Interface Implementations

IBarControl.DisplayStyle

Gets the display style of command links in the bar control.

BarControlDisplayStyle IBarControl.DisplayStyle { get; }

Returns

BarControlDisplayStyle:

A BarControlDisplayStyle that specifies the display style.

Inherited Members