ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Named Style Defaults

As in Microsoft Word, a Style object in True DBGrid can inherit its characteristics from another style, referred to as the parent style. For a newly created grid, the Normal style is the parent (or grandparent) of all named styles. Its default properties are as follows:

Alpha

255

BackColor

System.Drawing.Color.White

BackColor2

System.Drawing.Color.White

BackgroundImage

None

BackgroundPictureDrawMode

BackgroundPictureDrawModeEnum.Stretch

Font

Microsoft Sans Serif, 8.25pt

ForeColor

System.Drawing.Color.Black

ForeGroundImage

None

ForegroundPicturePosition

ForegroundPicturePositionEnum.LeftOfText

GammaCorrection

False

GradientMode

None

HorizontalAlignment

AlignHorzEnum.General

Locked

False

Padding

0, 0, 0, 0

Trimming

Character

VerticalAlignment

AlignVertEnum.Top

WrapText

False

The Heading and Footing styles are defined similarly. Each inherits from the Normal style, and each overrides the following properties:

BackColor

System.Drawing.SystemColors.Control

ForeColor

System.Drawing.Color.Black

VerticalAlignment

AlignVertEnum.Center

The Heading style overrides one additional property that the Footing style does not:

WrapText

True

The Selected style also inherits from Normal and overrides two color properties:

BackColor

System.Drawing.SystemColors.Highlight

ForeColor

System.Drawing.SystemColors.HighlightText

The same is True of the HighlightRow style, which uses the inverse of the color settings for the default Normal style:

BackColor

System.Drawing.SystemColors.Text

ForeColor

System.Drawing.SystemColors.HighlightText

The EvenRow, OddRow, and FilterBar styles inherit from Normal, but only the EvenRow style overrides any properties:

BackColor

System.Drawing.Color.Aqua

The only styles that do not inherit directly from Normal are the Caption and RecordSelector styles, which inherit from the Heading style. The reason that grid and split captions are centered by default is that the Caption style specializes the following property:

HorizontalAlignment

AlignHorzEnum.Center


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.