Skip to main content
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.v24.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 Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

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