BarItemLink.UserDefine Property
Gets or sets link options that specify which link settings are determined by a user.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.2.dll
Declaration
[Browsable(false)]
[XtraSerializableProperty(999)]
public BarLinkUserDefines UserDefine { get; set; }
Property Value
Type | Description |
---|---|
BarLinkUserDefines | A bitwise combination of BarLinkUserDefines enumeration members that represent link options. |
Available values:
Name | Description |
---|---|
None | If active, disables all other options. |
Caption | If active, the link’s caption is specified by the BarItemLink.UserCaption property. Otherwise, the caption is specified by the item’s BarItem.Caption property. |
Glyph | If active, the link’s image is specified by the BarItemLink.UserGlyph property. Otherwise, the image is specified by the item’s BarItem.Glyph property. |
PaintStyle | If active, the link’s painting style is specified by the BarItemLink.UserPaintStyle property. Otherwise, the painting style is specified by the item’s BarItem.PaintStyle property. |
Width | If active, the link’s width is specified by the BarItemLink.UserWidth property. Otherwise, the width is specified by the item’s BarItem.Width property. |
KeyTip | If active, a key tip has been assigned to a link via the BarItemLink.KeyTip property. Otherwise, no key tip has been assigned to the link. |
DropDownKeyTip | If active, a key tip has been assigned to a link via the BarButtonItemLink.DropDownKeyTip property. Otherwise, no key tip has been assigned to this property. |
RibbonStyle | If active, the link’s style is specified by the BarItemLink.UserRibbonStyle property. Otherwise, the caption is specified by the item’s BarItem.RibbonStyle property. |
Alignment | If active, the link’s alignment is specified by the BarItemLink.UserAlignment property. Otherwise, the caption is specified by the item’s BarItem.Alignment property. |
EditWidth | If active, the width of an editor within the BarEditItemLink is specified by the BarItemLink.UserEditWidth property. Otherwise, the caption is specified by the item’s BarEditItem.EditWidth property. |
Remarks
This property controls whose link settings can be determined by a user. It specifies whether users can apply different captions, paint styles, widths and glyphs to individual links that correspond to the same item. Note that single options can be enabled/disabled only in code, as shown in the example below. To disable all user defined options, call the BarItemLink.Reset method.
Example
The sample code below demonstrates how to check whether the specified link option (BarLinkUserDefines.Caption in our case) is active. If the option is currently disabled, it is activated.
using DevExpress.XtraBars;
// ...
if ((item1.Links[0].UserDefine & BarLinkUserDefines.Caption) == 0)
item1.Links[0].UserDefine |= BarLinkUserDefines.Caption;