IRibbonCategory.Visible

Syntax

Visible: Boolean;

Description

The Visible property determines whether the tab is displayed on the ribbon.

Comments

Available values:

Example

To execute the example, locate the following components on the form: Ribbon, Button and Label named Ribbon1, Button1 and Label1, respectively.

Add links to the ExtCtrls, Forms system assemblies.

The example is a handler of the OnCreate event for the form and the OnClick event for the Button component.

Sub IRibbonCategory_VisibleFormOnCreate(Sender: Object; Args: IEventArgs);
Var
    RCategory: IRibbonCategory;
    i: Integer;
Begin
    // Delete label text
    Label1.Text := "";
    
For i := 1 To 5 Do
    
    // Create a tab
        RCategory := New RibbonCategory.Create;
        
// Add a tab on the ribbon
        Ribbon1.Categories.Add(RCategory);
        
// Specify tab text
        RCategory.Text := "Tab " + i.ToString;
    End For;
End Sub IRibbonCategory_VisibleFormOnCreate;

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    RCategory: IRibbonCategory;
Begin
    // Specify label text if active tabs are missing
    If Ribbon1.ActiveCategory = Null Then
    
    Label1.Text := "There are no active tabs";
    Else
    
    // Get active tab
        RCategory := Ribbon1.ActiveCategory;
        
// Hide tab on the ribbon
        RCategory.Visible := False;
    End If;
End Sub Button1OnClick;

After executing the example a ribbon with five tabs is created on the form. The active tab is hidden on button click. If there are no active tabs, a corresponding message will be displayed in the Label component.

See also:

IRibbonCategory