ComponentOne True DBGrid for WinForms
How to Use Styles / Built-In Named Styles / Named Style Defaults
In This Topic
    Named Style Defaults
    In This Topic

    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:

    Property Setting
    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:

    Property Setting
    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:

    Property Setting
    WrapText True

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

    Property Setting
    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:

    Property Setting
    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:

    Property Setting
    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 specifies the following property:

    Property Setting
    HorizontalAlignment AlignHorzEnum.Center
    See Also