Back to Devexpress

BarItem.RibbonStyle Property

windowsforms-devexpress-dot-xtrabars-dot-baritem-a4375d5c.md

latest5.9 KB
Original Source

BarItem.RibbonStyle Property

Gets or sets the options that specify the bar item’s possible states within a Ribbon Control.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Behavior")]
[SupportedByBarManager(SupportedByBarManagerKind.NonSupported)]
public RibbonItemStyles RibbonStyle { get; set; }
vb
<DXCategory("Behavior")>
<SupportedByBarManager(SupportedByBarManagerKind.NonSupported)>
Public Property RibbonStyle As RibbonItemStyles

Property Value

TypeDescription
RibbonItemStyles

A set of RibbonItemStyles flags that specify the bar item’s possible states within a Ribbon Control.

|

Available values:

NameDescription
Default

If active, an item’s possible states with a Ribbon Control are determined based on the item’s settings. For example, if the item is associated with a small image and isn’t associated with a large image, its possible states within the Ribbon Control are RibbonItemStyles.SmallWithoutText and RibbonItemStyles.SmallWithText.

| | Large |

If active, a bar item can be displayed as a large bar item.

| | SmallWithText |

If active, an item can be displayed like a smal bar item with its caption.

| | SmallWithoutText |

If active, an item can be displayed like a smal bar item without its caption.

| | All |

If active, enables all other options.

|

Remarks

The following code shows how to enable and disable RibbonItemStyles options:

csharp
idNew.RibbonStyle |= DevExpress.XtraBars.Ribbon.RibbonItemStyles.Large;
idNew.RibbonStyle |= DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText;
// ...
idNew.RibbonStyle &= ~DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText;
vb
idNew.RibbonStyle Or DevExpress.XtraBars.Ribbon.RibbonItemStyles.Large
idNew.RibbonStyle Or DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText
' ...
idNew.RibbonStyle And Not DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText

The icon size for all “small” styles is 16x16 pixels, and 32x32 pixels for “large”. To change these sizes, add a BarAndDockingController component and modify its PropertiesRibbon.DefaultGlyphSize and PropertiesRibbon.DefaultLargeGlyphSize properties.

csharp
barAndDockingController1.PropertiesRibbon.DefaultGlyphSize = 32;
barAndDockingController1.PropertiesRibbon.DefaultLargeGlyphSize = 64;
vb
barAndDockingController1.PropertiesRibbon.DefaultGlyphSize = 32
barAndDockingController1.PropertiesRibbon.DefaultLargeGlyphSize = 64

The following code snippets (auto-collected from DevExpress Examples) contain references to the RibbonStyle property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/CS/MultiPaneExtension/MultiPaneModule.cs#L195

csharp
barItem.ImageOptions.SvgImage = global::MultiPaneExtension.Properties.Resources.AddChartPaneButton;
barItem.RibbonStyle = RibbonItemStyles.All;
barItem.ItemClick += OnEnableClick;

dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineModule.cs#L103

csharp
barItem.ItemClick += OnEditConstantLinesClick;
barItem.RibbonStyle = RibbonItemStyles.All;
return barItem;

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/VB/MultiPaneExtension/MultiPaneModule.vb#L167

vb
barItem.ImageOptions.SvgImage = My.Resources.AddChartPaneButton
barItem.RibbonStyle = RibbonItemStyles.All
AddHandler barItem.ItemClick, AddressOf OnEnableClick

See Also

BarItem Class

BarItem Members

DevExpress.XtraBars Namespace