Click or drag to resize
OGBrush Class
This class is used to paint the interior of a grid cell.
Inheritance Hierarchy
SystemObject
  Stingray.GridOGBrush

Namespace: Stingray.Grid
Assembly: Stingray.GridUtils (in Stingray.GridUtils.dll) Version: [TAG_DECIMAL_VERSION]
Syntax
[SerializableAttribute]
public class OGBrush : ICloneable, ISerializable

The OGBrush type exposes the following members.

Constructors
  NameDescription
Public methodOGBrush
Initializes a new OGBrush object.
Public methodOGBrush(OGBrush)
Initializes a new OGBrush object from another one.
Protected methodOGBrush(SerializationInfo, StreamingContext)
Internal.
Top
Methods
  NameDescription
Public methodClone
Creates a copy of this brush.
Public methodEquals
Indicates whether this brush and a specified object are equal.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Calculates the hash code for this brush.
(Overrides ObjectGetHashCode.)
Public methodMakeGdiPlusBrush
Converts an OG Brush into a GDI+ brush object.
Public methodStatic memberOGHatchedBrush(Color, HatchStyle)
Creates a hatched brush using the specified foreground color and hatch style.
Public methodStatic memberOGHatchedBrush(Color, Color, HatchStyle)
Creates a hatched brush using the specified foreground color, background color, and hatch style.
Public methodStatic memberOGHollowBrush
Creates a hollow brush.
Public methodStatic memberOGSolidBrush
Creates a solid brush using the specified background color.
Top
Fields
  NameDescription
Protected fieldbackColor
The background color of this brush.
Protected fieldforeColor
The foreground color of this brush.
Protected fieldhatch
The hatch style of this brush.
Protected fieldstyle
The brush style of this brush.
Top
Properties
  NameDescription
Public propertyBackColor
Gets the background color for the brush.
Public propertyDescription
Returns a string description of this brush.
Public propertyForeColor
Gets the foreground color for the brush.
Public propertyHatch
Gets the hatch style used to paint the interior of a grid cell.
Public propertyStyle
Gets the brush style used to paint the interior of a cell.
Top
Remarks
An instance of an OGBrush can be assigned to the Interior property of the Style of a grid cell to paint the interior of the cell with a given solid foreground and background color, or with a hatched pattern. The following C# code shows two ways that OGBrush can be used to paint the interior of grid cell 1,1 using a cross hatch with a black foreground and a Bisque background.
// Method 1: Create a Style, assign its Interior, and apply the style
Style s = new Style();
s.Interior = Stingray.Grid.OGBrush.OGHatchedBrush(Color.Black, Color.Bisque, HatchStyle.Cross);
GridControl1[1, 1].Style = s;

// Method 2: Directly manipulate the Interior property of the Style
GridControl1[1, 1].Style.Interior = Stingray.OG.OGBrush.OGHatchedBrush(Color.Black, Color.Bisque, HatchStyle.Cross);
See Also