Represents ribbon bar control.
System.Object
Eplan.EplApi.Gui.RibbonBar
Example below shows how to avoid GUI flickering and make sure that RibbonBar will be refreshed just after the add operations are completed. Parameter refreshAfterChanges=true means that refresh will be executed only once on RibbonBar destructor, in this case at the end of using() statement. This technique can be used also for removing elements from RibbonBar.
using (var ribbonBar = new RibbonBar(true))
{
var ribbonTab = ribbonBar.AddTab("MyTab1") ?? ribbonBar.GetTab("MyTab1");
var commandGroup = ribbonTab.AddCommandGroup("MyExampleActions");
commandGroup.AddCommand("MyExampleAction1", "ExampleAction /PARAM:1");
commandGroup.AddCommand("MyExampleAction2", "ExampleAction /PARAM:2");
commandGroup.AddCommand("MyExampleAction3", "ExampleAction /PARAM:3");
}
Example of adding a command to the last position of the ribbon
RibbonBar ribbonBar = new RibbonBar();
ribbonBar.AddCommand("New ribbon button text", "XPartsManagementStart", new RibbonIcon(CommandIcon.Circle_0));
Example of adding a tab, command group and a command
var newTab = new Eplan.EplApi.Gui.RibbonBar().AddTab("New API tab");
var commandGroup = newTab.AddCommandGroup("New API command group");
var command = commandGroup.AddCommand("New API command", "XPartsManagementStart");