Skip to main content
Bar

BarBaseButtonItem.Toggle() Method

Toggles the button item’s state.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void Toggle()

Remarks

If a button item’s BarBaseButtonItem.ButtonStyle property is set to BarButtonStyle.Check, it can have two states (pressed and elevated). The item’s state is determined by the Boolean BarBaseButtonItem.Down property. The Toggle method inverts the value of the BarBaseButtonItem.Down property and thus toggles the button item’s state.

A Toggle method call has no effect if the BarBaseButtonItem.ButtonStyle property isn’t set to BarButtonStyle.Check or if the button item is disabled (the BarItem.Enabled property is set to false).

See Also