foreach (BaseItem item in ribbonControl1.Items)
{
RibbonTabItem ribbonTab = item as RibbonTabItem;
if (ribbonTab != null)
{
RibbonPanel panel = ribbonTab.Panel;
foreach (Control panelControl in panel.Controls)
{
RibbonBar ribbonBar = panelControl as RibbonBar;
if (ribbonBar != null)
{
//ribbonBar.Visible = false;
foreach (BaseItem ribbonBarItem in ribbonBar.Items)
{
ButtonItem btn = ribbonBarItem as ButtonItem;
btn.Enabled = false;
//ribbonBarItem.Enabled = false;
}
}
}
}
}