Add(Element: IRibbonContext);
Add(Element: Prognoz.Platform.Interop.Forms.RibbonContext);
Element. A context tab that should be added to the collection.
The Add method adds the specified context tab to the collection.
If the context tab is created dynamically, it should be added to the ribbon after creation. To do this, it must be included to the collection by means of the Add or IRibbonContexts.Insert method. The Add method adds a tab to the end of the collection. Parameters of the context tab can be changed after addition.
Executing the example requires a form, a button with the Button1 name located on it and the Ribbon component with the Ribbon1 name.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RContext: IRibbonContext;
ChildCategory: IRibbonCategory;
ChildPanel: IRibbonPanel;
Begin
RContext := New RibbonContext.Create;
Ribbon1.Contexts.Add(RContext);
RContext.Text := "Table";
RContext.Visible := True;
ChildCategory := RContext.Categories.Item(0);
ChildCategory.Text := "Data";
ChildPanel := New RibbonPanel.Create;
ChildCategory.Panels.Add(ChildPanel);
ChildPanel.Text := "Clipboard";
End Sub Button1OnClick;
On clicking the button a context tab is created in the ribbon. A panel will be created in the area of the child tab automatically created for the context tab.
See also: