In This Article

ItemVariantBehavior Enum

Specifies how controls behave in terms of applying variants.

public enum ItemVariantBehavior

Remarks

When set on a RibbonControlGroup, the value specifies how child controls of a RibbonControlGroup are assigned a variant size based on the current value of the VariantSize property, but only when the parent's RibbonGroup's LayoutMode is Stacking. The RibbonControlGroup control is intended to be used directly as a child of a RibbonGroup control. In this scenario, the parent RibbonGroup automatically sets the VariantSize property to the group's variant size, and therefore enables the behavior specified by this enumeration when the parent's RibbonGroup's LayoutMode is Stacking.

Alternatively, when set on a control such as a button (e.g., ToolBarItemVariantBehavior), the value specifies the allowed variant sizes when on a ribbon in Simplified layout mode or a toolbar. Note that these scenarios do not allow large variant sizes.

Fields

Name Description
All

Controls will use all variant sizes. This option provides the largest number of variants for controls.

When in a RibbonControlGroup, controls use a Large variant size when the VariantSize of the RibbonControlGroup is Large. They change to a Medium variant size when the VariantSize of the RibbonControlGroup is Medium. They change to a Small variant size when the VariantSize of the RibbonControlGroup is Small.

AlwaysLarge

Controls will only use the Large variant size.

When in a RibbonControlGroup, controls always use a Large variant size no matter what the VariantSize of the RibbonControlGroup is. This option is generally the same as not wrapping controls in a RibbonControlGroup at all, but is useful if wanting to support separators around a set of controls.

AlwaysMedium

Controls will only use the Medium variant size.

When in a RibbonControlGroup, controls always use a Medium variant size no matter what the VariantSize of the RibbonControlGroup is.

AlwaysSmall

Controls will only use the Small variant size.

When in a RibbonControlGroup, controls always use a Small variant size no matter what the VariantSize of the RibbonControlGroup is.

NeverLarge

Controls will use the Medium and Small variant sizes.

When in a RibbonControlGroup, controls use a Medium variant size when the VariantSize of the RibbonControlGroup is Large or Medium. They change to a Small variant size when the VariantSize of the RibbonControlGroup is Small.

NeverMedium

Controls will use the Large and Small variant sizes.

When in a RibbonControlGroup, controls use a Large variant size when the VariantSize of the RibbonControlGroup is Large. They change to a Small variant size when the VariantSize of the RibbonControlGroup is Medium or Small.

NeverSmall

Controls will use the Large and Medium variant sizes.

When in a RibbonControlGroup, controls use a Large variant size when the VariantSize of the RibbonControlGroup is Large. They change to a Medium variant size when the VariantSize of the RibbonControlGroup is Medium or Small.