HeaderBackColor Property

DataGrid.HeaderBackColor Property

 

Gets or sets the background color of all row and column headers.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public Color HeaderBackColor { get; set; }

Property Value

Type: System.Drawing.Color

A Color that represents the background color of row and column headers. The default is the system color for controls, Control.

Exception Condition
ArgumentNullException

While trying to set the property, a Color.Empty was passed.

The following code example sets the background color of column headers using a value passed to the method.


Private Sub SetHeaderBackClr(Byval myGrid As DataGrid)
   myGrid.HeaderBackColor = System.Drawing.Color.CadetBlue
End Sub

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft