Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ShapeLine.Fill Property

Allows you to specify fill options for a line and a shape’s border.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v20.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

LineFillFormat Fill { get; }

Property Value

Type Description
LineFillFormat

An object that contains line fill settings.

Remarks

Use the Fill property to access fill settings that allow you to customize a shape line’s appearance.

No Fill

Use the Shape.Line.Fill.SetNoFill method to remove a fill from a line.

The example below shows how to use the SetNoFill method to remove an outline from a rectangle.

Rich_ShapeLine_NoFill

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
rectangle.Fill.SetSolidFill(Color.FromArgb(0xFF, 0xEE, 0xAD));
// Remove the rectangle's outline.
rectangle.Line.Fill.SetNoFill();

Solid Fill

Use the Shape.Line.Fill.SetSolidFill method to apply a color to a line.

Rich_ShapeLine_SolidFill

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
rectangle.Fill.SetNoFill();
// Format the rectangle's outline.
ShapeLine border = rectangle.Line;
// Fill the outline with a color.
border.Fill.SetSolidFill(Color.FromArgb(0x4D, 0x64, 0x8D));
// Set the line width.
border.Thickness = 6;

Gradient Fill

Use the Shape.Line.Fill.SetGradientFill method to fill a line with a gradient of two or more colors.

Rich_ShapeLine_GradientFill

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
rectangle.Fill.SetNoFill();
// Format the rectangle's outline.
ShapeLine border = rectangle.Line;
// Apply a gradient of two colors to the outline.
border.Fill.SetGradientFill(GradientType.Linear, Color.FromArgb(0x4D, 0x64, 0x8D), Color.FromArgb(0xFF, 0x8B, 0x94));
// Set the line width.
border.Thickness = 6;
See Also