DataGridViewCellStyle::ForeColor Property

 

Gets or sets the foreground color of a DataGridView cell.

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

public:
property Color ForeColor {
	Color get();
	void set(Color value);
}

Property Value

Type: System.Drawing::Color

A Color that represents the foreground color of a cell. The default is Empty.

The ForeColor property typically should specify a color that contrasts with the BackColor property.

The following code example demonstrates how to set the ForeColor and BackColor properties for cells in alternating rows. This code example is part of a larger example provided for the DataGridViewCellStyle class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: