IRibbonCategories.Add

Fore Syntax

Add(Element: IRibbonCategory);

Fore.NET Syntax

Add(Element: Prognoz.Platform.Interop.Forms.RibbonCategory);

Parameters

Element. It is a tab that should be added to the collection of component tabs.

Description

The Add method adds the specified tab to the collection of ribbon tabs.

Comments

If the tab is created dynamically, it should be added to the ribbon after creation. It should be included in the collection using the Add or Insert method. The Add method adds a tab to the end of the collection. Tab parameters can be changed after addition.

Example

Executing the example requires a form, a button named Button1 on the form, the Ribbon component named Ribbon1, and two ImageList components named SImage and LImage. Small and large images to be used by tab controls are loaded to the SImage and LImage components respectively.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    RCategory: IRibbonCategory;
Begin
    RCategory := New RibbonCategory.Create;
    Ribbon1.Categories.Add(RCategory);
    RCategory.Text := "Edit";
    RCategory.LargeImages := LImage;
    RCategory.SmallImages := SImage;
    RCategory.Keys := "R";
End Sub Button1OnClick;

Clicking the button creates a new ribbon tab. Various parameters are defined for the tab.

See also:

IRibbonCategories