BarButtonItem.DefaultDropDownLink Property
Assigns all core settings of a target link (caption, image, click event handler, and others) to this Bar Button Item.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
BarItemLink | The link whose settings are to be copied. |
Remarks
If a Bar Button has a drop-down menu (see the ButtonStyle property description), you can disable the ActAsDropDown property to split this button into two elements:
- The button itself. When users click it, the button’s own ItemClick event fires.
- The drop-down button. Shows a drop-down menu when clicked.
The DefaultDropDownLink
property allows you to associate the main button element with any bar item link from its drop-down menu. This way, the copied link becomes easily accessible since users don’t need to invoke a drop-down menu to click it.
The code below illustrates how to copy settings from the last clicked link.
using DevExpress.XtraBars;
void UpdateDefaultButton(ItemClickEventArgs args) {
btnMain.DefaultDropDownLink = args.Link;
}
// ItemClick event handlers for drop-down menu buttons
void OnBtn1Click(object sender, ItemClickEventArgs e) {
UpdateDefaultButton(e);
// Do something
}
void OnBtn2Click(object sender, ItemClickEventArgs e) {
UpdateDefaultButton(e);
// Do something
}
void OnBtn3Click(object sender, ItemClickEventArgs e) {
UpdateDefaultButton(e);
// Do something
}