Export (0) Print
Expand All

ListViewItem.ForeColor Property

Gets or sets the foreground color of the item's text.

[Visual Basic]
Public Property ForeColor As Color
[C#]
public Color ForeColor {get; set;}
[C++]
public: __property Color get_ForeColor();
public: __property void set_ForeColor(Color);
[JScript]
public function get ForeColor() : Color;
public function set ForeColor(Color);

Property Value

A Color that represents the foreground color of the item's text.

Remarks

You can use the ForeColor property to change the color of the item text. This property can be used if you want to use different background and foreground color combinations (using the BackColor property to set the background color) to differentiate one item from another. For example, you could set the ForeColor property to Color.Red to identify items that have a negative number associated with them or have failed item validation.

If you want to use the same foreground color for all subitems of an item, set the UseItemStyleForSubItems property to true. This will cause the colors and fonts specified for the item to be used for all subitem text.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ListViewItem Class | ListViewItem Members | System.Windows.Forms Namespace | Color | BackColor

Show:
© 2014 Microsoft