Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Customizing Row, Column, and Cell Appearance > Customizing the Appearance of Headers > Customizing the Style of Header Cells |
You can customize the style of header cells if you want to change the default appearance. You can set or customize many features, including:
To customize style properties for the header classes, set the default style of the header cells by setting the RowHeader DefaultStyle property or the ColumnHeader DefaultStyle property. For more information on what can be set, refer to the StyleInfo object and the RowHeader and ColumnHeader objects.
Before | |
After |
To customize using the renderers, set their members to customize the appearance of headers. The renderers used in the Office2013 style are shown and listed in the following figure.
You can also use default classes to customize many of the header appearance properties by setting the properties of the Columns.DefaultColumn class and the Rows.DefaultRow class.
You can also set the grid lines around the header cells to change the three-dimensional appearance. Refer to Customizing the Header Grid Lines.
You can also add gradients to the header cells. Refer to Adding a Gradient to Header Cells.
This example code defines a style with new colors and applies it to the column header as shown in the figure in this topic.
C# |
Copy Code
|
---|---|
fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off; // Define a new style. FarPoint.Win.Spread.StyleInfo darkstyle = new FarPoint.Win.Spread.StyleInfo(); darkstyle.BackColor = Color.Teal; darkstyle.ForeColor = Color.Yellow; // Apply the new style to the column header of a sheet. fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = darkstyle; |
VB |
Copy Code
|
---|---|
FpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off ' Define a new style. Dim darkstyle As New FarPoint.Win.Spread.StyleInfo() darkstyle.BackColor = Color.Teal darkstyle.ForeColor = Color.Yellow ' Apply the new style to the column header of a sheet. FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = darkstyle |