ArcObjects Library Reference (Controls)  

IGraphicProperties.FillSymbol Property

The fill symbol used by the CommandsEnvironment singleton.

[Visual Basic .NET]
Public Property FillSymbol As IFillSymbol
[C#]
public IFillSymbol FillSymbol {get; set;}
[C++]
HRESULT get_FillSymbol(
  IFillSymbol** ppFillSymbol
);
[C++]
HRESULT put_FillSymbol(
  IFillSymbol* ppFillSymbol
);
[C++]

Parameters

ppFillSymbol [out, retval]

  ppFillSymbol is a parameter of type IFillSymbol

ppFillSymbol [in]

  ppFillSymbol is a parameter of type IFillSymbol

Product Availability

Available with ArcGIS Engine.

Description

The FillSymbol used by the ControlsNewCircleTool, ControlsNewEllipseTool, ControlsNewPolygonTool, ControlsNewRectangleTool and the IHookActions methods. By default the IFillSymbol::Color is yellow and the IFillSymbol::Outline is black with a width of 1.

The IFillSymbol::Color and IFillSymbol::Outline return clones, so to change the default color and outline set an IColor object into IFillSymbol::Color and an ILineSymbol into IFillSymbol::Outline.

[C#]

//Get the IGraphicProperties interface
IGraphicProperties graphicProperties = new CommandsEnvironmentClass();
//Get the IRgbColor interface
IRgbColor color = new RgbColorClass();
//Set the color to be red ((Red) + (Green * 256) + (Blue * 256 * 256))
color.RGB = 255;
//Get the ISimpleLineSymbol interface
ISimpleLineSymbol outline = (ISimpleLineSymbol) graphicProperties.FillSymbol.Outline;
//Set the color and width
outline.Color = color;
outline.Width = 3;

//Set the FillSymbol's color and outline
graphicProperties.FillSymbol.Color = color;
graphicProperties.FillSymbol.Outline = outline;

[Visual Basic .NET]

'Get the IGraphicProperties interface
Dim graphicProperties As IGraphicProperties = New CommandsEnvironmentClass
'Get the IRgbColor interface
Dim color As IRgbColor = New RgbColorClass
'Set the color to be red ((Red) + (Green * 256) + (Blue * 256 * 256))
color.RGB = 255

'Get the ISimpleLineSymbol interface
Dim outline As ISimpleLineSymbol = graphicProperties.FillSymbol.Outline
'Set the color and width
outline.Color = color
outline.Width = 3

'Set the FillSymbol's color and outline
graphicProperties.FillSymbol.Color = color
graphicProperties.FillSymbol.Outline = outline

See Also

IGraphicProperties Interface