Back to Devexpress

RibbonControl.PageHeaderItemLinks Property

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-ribboncontrol-d9f85826.md

latest5.3 KB
Original Source

RibbonControl.PageHeaderItemLinks Property

Gets a collection of bar item links displayed at the right edge of the control in the same row with tab headers.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[InheritableCollection]
[SkipRuntimeSerialization]
public RibbonPageHeaderItemLinkCollection PageHeaderItemLinks { get; }
vb
<Browsable(False)>
<InheritableCollection>
<SkipRuntimeSerialization>
Public ReadOnly Property PageHeaderItemLinks As RibbonPageHeaderItemLinkCollection

Property Value

TypeDescription
DevExpress.XtraBars.Ribbon.RibbonPageHeaderItemLinkCollection

A DevExpress.XtraBars.Ribbon.RibbonPageHeaderItemLinkCollection object representing the collection of bar item links.

|

Remarks

To display bar item links at the right edge of the control in the same row with tab headers, add them to the PageHeaderItemLinks collection.

To display bar items within the Quick Access Toolbar, add them to the RibbonQuickAccessToolbar.ItemLinks collection. To display bar items within a Ribbon Page Group, add them to the RibbonPageGroup.ItemLinks collection.

Example

You can display custom buttons in-line with tab headers. The buttons can be aligned near to the tab headers (left aligned) or near to the ribbon edge (right aligned).

To display a custom button in the tab header area:

  • use the CreateButton(String) method to create a button;
  • use the Alignment property to align the button near to tab headers or the ribbon edge;
  • you can also set the VisibleInSearchMenu property to false to hide the button in the Search Menu;
  • add the button to the PageHeaderItemLinks collection.

In the Ribbon Simple Pad demo, the ribbon displays the Share button aligned to the right. The example below shows how to add the Backward and Forward buttons.

csharp
using DevExpress.XtraBars;

BarButtonItem itemBackNav = RibbonControl1.Items.CreateButton("Backward");
itemBackNav.ImageIndex = 10;
itemBackNav.VisibleInSearchMenu = false;
itemBackNav.Alignment = BarItemLinkAlignment.Left;
itemBackNav.ItemClick += new ItemClickEventHandler(itemBackNav_ItemClick);
BarButtonItem itemFrwNav = RibbonControl1.Items.CreateButton("Forward");
itemFrwNav.ItemClick += new ItemClickEventHandler(itemFrwNav_ItemClick);
itemFrwNav.ImageIndex = 11;
itemFrwNav.VisibleInSearchMenu = false;
itemFrwNav.Alignment = BarItemLinkAlignment.Left;
RibbonControl1.PageHeaderItemLinks.AddRange(new BarItem[] { itemBackNav, itemFrwNav});

void itemFrwNav_ItemClick(object sender, ItemClickEventArgs e) {
    //...
}

void itemBackNav_ItemClick(object sender, ItemClickEventArgs e) {
    //...
}
vb
Imports DevExpress.XtraBars

Dim itemBackNav As BarButtonItem = RibbonControl1.Items.CreateButton("Backward")
itemBackNav.ImageIndex = 10
itemBackNav.VisibleInSearchMenu = False
itemBackNav.Alignment = BarItemLinkAlignment.Left
AddHandler itemBackNav.ItemClick, AddressOf itemBackNav_ItemClick
Dim itemFrwNav As BarButtonItem = RibbonControl1.Items.CreateButton("Forward")
AddHandler itemFrwNav.ItemClick, AddressOf itemFrwNav_ItemClick
itemFrwNav.ImageIndex = 11
itemFrwNav.VisibleInSearchMenu = False;
itemFrwNav.Alignment = BarItemLinkAlignment.Left
RibbonControl1.PageHeaderItemLinks.AddRange(New BarItem() {itemBackNav, itemFrwNav})

Private Sub itemFrwNav_ItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    '...
End Sub

Private Sub itemBackNav_ItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    '...
End Sub

See Also

Page Header Items

RibbonPageGroup.ItemLinks

RibbonQuickAccessToolbar.ItemLinks

RibbonControl Class

RibbonControl Members

DevExpress.XtraBars.Ribbon Namespace