DataGrid::ForeColor Property
.NET Framework (current version)
Gets or sets the foreground color (typically the color of the text) property of the System.Windows.Forms::DataGrid control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property Color ForeColor { virtual Color get() override; virtual void set(Color value) override; }
Property Value
Type: System.Drawing::ColorA Color that represents the foreground color. The default is WindowText color.
The following code example demonstrates the use of this member.
// String variable used to show message. String^ myString = "Selection backgound color changed from: "; // Store current foreground color of selected cells. Color myCurrentColor = myDataGrid->SelectionBackColor; myString = String::Concat( myString, myCurrentColor.ToString() ); // Reset selection background color to default. myDataGrid->ResetSelectionBackColor(); myString = String::Concat( myString, " to " ); myString = String::Concat( myString, myDataGrid->SelectionBackColor.ToString() ); // Show information about changes in color setting. MessageBox::Show( myString, "Selection background color information" );
.NET Framework
Available since 1.1
Available since 1.1
Show: