IVZControlStyle.SetBackground

Syntax

SetBackground(state: VisualizatorControlState; Value: IGxBrush);

Parameters

state. Control state.

Value. Control background brush.

Description

The SetBackground method determines the brush used to set control background for the specified state.

Example

Executing the example requires that the repository contains an express report with the EXP identifier. The module containing the example should have links to the Express, Metabase, Drawing and Visualizators system assemblies. The specified procedure should be called from the Main entry point.

Before executing the example, the bubble tree time line looks as shown on the IVZBubbleTree property description page.  Set new values of background and borders for this scale, get type of background brush and width of the border line:

Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Timeline: IVZTimeLine; // Time scale
    Style: IVZControlStyle; // Style
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get time line
    Timeline := BubbleTree.TimeLine;
    // Get time line style
    Style := Timeline.Style;
    // Set new background
    Style.SetBackground(VisualizatorControlState.ControlStateReleased, 
        New GxSolidBrush.Create(New GxColor.CreateRGB(127199255)));
    // Set new border color
    Style.SetBorderPen(VisualizatorControlState.ControlStateReleased,
        New GxPen.CreateSolid(New GxColor.CreateRGB(25500), 3));
    // Display background color brush type       
    Select Case Style.GetBackground(VisualizatorControlState.ControlStateReleased).BrushType
        Case GxBrushType.SolidColor: Debug.WriteLine("Background fill brush type - SolidColor");
        Case GxBrushType.HatchFill: Debug.WriteLine("Background fill brush type - HatchFill");
        Case GxBrushType.TextureFill: Debug.WriteLine("Background fill brush type - TextureFill");
        Case GxBrushType.PathGradient: Debug.WriteLine("Background fill brush type - PathGradient");
        Case GxBrushType.LinearGradient: Debug.WriteLine("Background fill brush type - LinearGradient");
    End Select;
    // Output border line width
    Debug.WriteLine("Border line width: " + 
        Style.GetBorderPen(VisualizatorControlState.ControlStateReleased).Width.ToString);
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, color of background fill and time line border line are changed in the bubble tree:

Also, the background color brush type and border line width are shown in the development environment console window:

Background color brush type - SolidColor

Border line width: 3

See also:

IVZControlStyle