ITabUserInteractiveSelections.Add

Fore Syntax

Add: ITabUserInteractiveSelection;

Fore.NET Syntax

Add: Prognoz.Platform.Interop.Tab.ITabUserInteractiveSelection;

Description

The Add method creates an interactive range and returns its settings.

Fore Example

Executing the example requires a form with the Button1 button on it, the TabSheetBox component named TabSheetBox1, and a component that is a data source for TabSheetBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    TSheet: ITabSheet;
    IntSelections: ITabUserInteractiveSelections;
    IntSelection: ITabUserInteractiveSelection;
Begin
    TSheet := TabSheetBox1.Source.GetTabSheet;
    IntSelections := TSheet.View.UserIntearactiveSelections;
    IntSelection := IntSelections.Add;
    IntSelection.BorderColor := GxColor.FromKnownColor(GxKnownColor.Red);
    IntSelection.BorderStyle := TabBorderStyle.Dash;
    IntSelection.InteractiveRestrictions := TabUserInteractiveSelectionChangeType.Top Or TabUserInteractiveSelectionChangeType.Bottom;
    IntSelection.Range := TSheet.ParseRange("B1:C5");
    IntSelection.Visible := True;
End Sub Button1OnClick;

Clicking the button creates an interactive range for table. Border drawing parameters are determined for this range, and a constraint is imposed: it is prohibited to change top and bottom range borders.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    TSheet: ITabSheet;
    IntSelections: ITabUserInteractiveSelections;
    IntSelection: ITabUserInteractiveSelection;
    GxColorCls: GxColorClassClass = New GxColorClassClass();
Begin
    TSheet := TabSheetBoxNet1.Source.GetTabSheet();
    IntSelections := TSheet.View.UserIntearactiveSelections;
    IntSelection := IntSelections.Add();
    IntSelection.BorderColor := GxColorCls.FromKnownColor(GxKnownColor.clRed);
    IntSelection.BorderStyle := TabBorderStyle.tbsDash;
    IntSelection.InteractiveRestrictions := TabUserInteractiveSelectionChangeType.tuistTop Or TabUserInteractiveSelectionChangeType.tuistBottom;
    IntSelection.Range := TSheet.ParseRange("B1:C5");
    IntSelection.Visible := True;
End Sub;

See also:

ITabUserInteractiveSelections