IMapBackground.Color

Syntax

Color: IGxColor;

Description

The Color property determines legend background solid fill color.

Comments

This property is relevant if the IMapBackground.Type property is set to MapBackgroundType.Color.

Example

Executing the example requires a form with the following components: the ReportBox component named ReportBox1, and the UiReport component named UiReport1. UiReport1 is a data source for ReportBox1. It is also required to have a regular report containing a map with enabled legend that is a data source for UiReport1.

Add links to the Drawing, Map, Report, Tab system assemblies.

Sub UserProc;
Var
    regrep: IPrxReport;
    sheet: IPrxSheet;
    table: IPrxTable;
    objects: ITabObjects;
    map: IMap;
    legend: IMapLegend;
    background: IMapBackground;
Begin
    // Get regular report
    regrep := UiReport1.Report;
    // Get map from regular report
    sheet := regrep.Activesheet;
    table := sheet As IPrxTable;
    objects := table.TabSheet.Objects;
    map := objects.Item(0).Extension As IMap;
    // Get map legend
    legend := map.View.Legend;
    // Get legend background on map
    background := legend.Background;
    // Set legend solid fill type
    background.Type := MapBackgroundType.Color;
    // Set legend fill color
    background.color := New GxColor.CreateRGB(1200120);
    // Refresh map
    map.Refresh;
End Sub UserPRoc;

After executing the example legend background color is changed.

See also:

IMapBackground