Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataGridTableStyle.SelectionForeColor Property

Gets or sets the foreground color of selected cells.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public Color SelectionForeColor { get; set; }
/** @property */
public Color get_SelectionForeColor ()

/** @property */
public void set_SelectionForeColor (Color value)

public function get SelectionForeColor () : Color

public function set SelectionForeColor (value : Color)

Not applicable.

Property Value

The Color that represents the foreground color of selected cells.

The following code example demonstrates the use of this member.

// Creates a common color dialog box.
ColorDialog myColorDialog = new ColorDialog();
myColorDialog.AllowFullOpen = false ;
// Allow the user to get help. 
myColorDialog.ShowHelp = true ;
// Set the initial color select to the current color.
myColorDialog.Color = customersStyle.SelectionForeColor; 
// Show color dialog box.
myColorDialog.ShowDialog();
// Set selection fore color to selected color.
customersStyle.SelectionForeColor = myColorDialog.Color;

// Creates a common color dialog box.
ColorDialog myColorDialog = new ColorDialog();

myColorDialog.set_AllowFullOpen(false);

// Allow the user to get help. 
myColorDialog.set_ShowHelp(true);

// Set the initial color select to the current color.
myColorDialog.set_Color(customersStyle.get_SelectionForeColor());

// Show color dialog box.
myColorDialog.ShowDialog();

// Set selection fore color to selected color.
customersStyle.set_SelectionForeColor(myColorDialog.get_Color());

// Creates a common color dialog box.
ColorDialog myColorDialog = new ColorDialog();

myColorDialog.set_AllowFullOpen(false);

// Allow the user to get help. 
myColorDialog.set_ShowHelp(true);

// Set the initial color select to the current color.
myColorDialog.set_Color(customersStyle.get_SelectionForeColor());

// Show color dialog box.
myColorDialog.ShowDialog();

// Set selection fore color to selected color.
customersStyle.set_SelectionForeColor(myColorDialog.get_Color());

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

Show:
© 2014 Microsoft