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

BarEditItem.AutoFillWidthInMenu Property

Gets or sets whether this BarEditItem‘s editor should be resized to fit the menu width or use its own width settings.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v19.1.dll

Declaration

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

Property Value

Type Default Description
DefaultBoolean **Default**

A DefaultBoolean enumerator value that specifies whether this BarEditItem editor should be resized to fit the menu width or use its own width settings.

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

Each BarEditItem‘s editor can have a certain width specified by the BarEditItem.Size.Width property. When in menus, BarEditItems can either keep this width or adapt to the width of this parent menu. The figure below illustrates a sample PopupMenu that demonstrates the AutoFillWidthInMenu property effect.

XtraBars - AutoFillWidthInMenu

  • 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 DefaultBoolean.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 DefaultBoolean.True, the editor automatically fills all the space available and consumes the gap seen in the Font Size item.

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

If the AutoFillWidthInMenu property is set to DefaultBoolean.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.

See Also