ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Example 6 - Changing the BackColor of the Style Property

In the first example, setting the Font member of the grid's Style property affected the entire grid, including each caption bar, column header, and column footer. However, the same is not true of the BackColor and ForeColor properties. Since the built-in Caption, Heading, and Footing styles override both of these properties, only the data cells of the grid are displayed with a lavender background.

The following code chages the font member of the Style property:

·      Visual Basic

Me.C1TrueDBGrid1.Style.BackColor = System.Drawing.Color.Lavender

·      C#

this.C1TrueDBGrid1.Style.BackColor = System.Drawing.Color.Lavender;

·      Delphi

Self.C1TrueDBGrid1.Style.BackColor := System.Drawing.Color.Lavender;

 


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