The following code shows how to iterate through the collection of visible Ribbon pages.
To access a RibbonControl’s collection of visible pages, the RibbonControl.TotalPageCategory property is used. The object returned by this property allows you to access all pages and only visible pages.
using DevExpress.XtraBars.Ribbon;
ArrayList visiblePages = RibbonControl1.TotalPageCategory.GetVisiblePages();
foreach (RibbonPage page in visiblePages) {
if (page.Text == "Selection") {
page.Visible = false;
break;
}
}
Imports DevExpress.XtraBars.Ribbon
Dim visiblePages As ArrayList = RibbonControl1.TotalPageCategory.GetVisiblePages()
For Each page As RibbonPage In visiblePages
If page.Text = "Selection" Then
page.Visible = False
Exit For
End If
Next