IEaxRangeCellStyles.GetByRange

Syntax

GetByRange(Range: ITabRange): ITabCellStyle;

Parameters

Range. Cell range.

Description

The GetByRange method returns style of a selected cell range.

Comments

If the Range parameter is set to Null, the GetByRange property returns an empty style.

Example

Executing the example requires a form, a button named Button1 on it, the LanerBox component and the UiErAnalyzer component with the UiErAnalyzer1 identifier, that is a data source for LanerBox. The workbook of time series database should be loaded to UiErAnalyzer1. Add a link to the Drawing system assembly.

The example is executed on clicking the button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Grid: IEaxGrid;
    View: ITabView;
    Range: ITabRange;
    Style: IEaxTableStyle;
    CStyles: IEaxRangeCellStyles;
    CellStyle: ITabCellStyle;
Begin
    Grid := UiErAnalyzer1.ErAnalyzer.Grid;
    View := Grid.TabSheet.View;
    Range := View.Selection.Range;
    Style := Grid.Style;
    CStyles := Style.RangeCellStyles;
    CellStyle := CStyles.GetByRange(Range);
    If CellStyle.Font <> Null Then
        Debug.WriteLine("   font - " + CellStyle.Font.Name);
        If CellStyle.Font.Color <> Null Then
            Debug.WriteLine("   font color - " + CellStyle.Font.Color.Name);
        End If;
    End If;
    CStyles.RemoveByRange(Range);
    Grid.Refresh;
End Sub Button1OnClick;

After executing the example the console window shows description of the style applied to the selected range of workbook cells. Then the style is deleted.

See also:

IEaxRangeCellStyles