Skip to main content
A newer version of this page is available. .
Bar

BarEditItem.AutoFillWidthInMenu Property

Gets or sets whether links to this BarEditItem are stretched to fit the menu width.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v19.2.dll

Declaration

[DefaultValue(DefaultBoolean.Default)]
public virtual DefaultBoolean AutoFillWidthInMenu { get; set; }

Property Value

Type Default Description
DefaultBoolean **Default**

True, if the item is stretched up to the menu width; False, if the item uses its width settings; Default, if the behavior is inherited from the parent menu.

Available values:

Name Description
True

Corresponds to a Boolean value of true.

False

Corresponds to a Boolean value of false.

Default

The value is determined by the current object’s parent object setting (e.g., a control setting).

Remarks

The BarItem.Size.Width and BarEditItem.EditWidth properties allow you to specify the item and editor width. Set the AutoFillWidthInMenu property to True to ignore these settings and automatically stretch the item up to the menu width.

The figure below shows several items with the following settings:

  • The Style bar edit item has the editor width set to 300 pixels. For this item, the AutoFillWidthInMenu property value is irrelevant, since its editor is the widest item within the menu and there is no free space that the editor can automatically fill.
  • The Font Size bar edit item contains a 100 pixels wide editor and has the AutoFillWidthInMenu property set to False. This item is drawn with its own width, which causes a clearly visible gap between the editor and the item caption.
  • The Find bar edit item is only 50 pixels wide, so it should be even shorter than the previous edit item. But since its AutoFillWidthInMenu property equals True, the editor automatically fills all the space available and consumes the gap seen in the Font Size item.

    XtraBars - AutoFillWidthInMenu

If the AutoFillWidthInMenu property is set to Default, the BarEditItem derives its behavior from the parent pop-up menu or sub-menu. To specify this global behavior common to all editors within a menu, use the BarSubItem.AutoFillEditorWidth or PopupMenu.AutoFillEditorWidth property.

Tip

To set a similar behavior for BarEditItem objects hosted within regular toolbars, use the BarEditItem.AutoFillWidth property.

See Also