RibbonControl.SelectPage(RibbonPage) Method

Activates the specified ribbon page. This method can be used to activate pages in merged ribbons.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v20.1.dll


public void SelectPage(
    RibbonPage page
Public Sub SelectPage(
    page As RibbonPage


Name Type Description
page RibbonPage

A RibbonPage object specifying the page to select.


When ribbons are not merged, you can activate a page by using the SelectPage method or the RibbonControl.SelectedPage property. These means are equivalent.

//These two lines or code have the same effect in a not merged ribbon.
ribbon.SelectedPage = ribbonPage;

When ribbons are merged, to activate a page in a ribbon, use the SelectPage method.

//When ribbons are merged, use this code to activate a page.
//This code allows you also to select a ribbon page.

When you merge a child ribbon with a parent ribbon, copies of child ribbon pages are created and added to the parent ribbon. The RibbonControl.Pages and RibbonPageCategory.Pages collections contain parent pages, while the RibbonControl.MergedPages and RibbonPageCategory.MergedPages collections contain copies of child pages. Another way to activate a child ribbon page is to locate its copy in the RibbonControl.MergedPages or RibbonPageCategory.MergedPages collection, and then pass it to the SelectPage method or assign it to the RibbonControl.SelectedPage property.

//Selects the Templates page of a child ribbon merged with a parent ribbon.
parentRibbon.SelectedPage = parentRibbon.MergedPages["Templates"];

When ribbons are merged, you cannot use the RibbonControl.SelectedPage property to activate a page in a child ribbon.

//When ribbons are merged, this code has no effect.
childRibbon.SelectedPaged = childRibbonPage;
See Also