Skybound VisualStyles

ThemePaint.GetForeColor Method 

Returns the foreground color of text for a specified control that supports visual styles.

[Visual Basic]
Public Shared Function GetForeColor( _
   ByVal ctl As Control, _
   ByVal themeClass As String, _
   ByVal themePart As Integer, _
   ByVal themeState As Integer _
) As Color
[C#]
public static Color GetForeColor(
   Control ctl,
   string themeClass,
   int themePart,
   int themeState
);

Parameters

ctl
The Control whose foreground color is returned.
themeClass
Specifies the class of control.
themePart
The ID of the part for which the foreground color is returned.
themeState
The ID of the state for which the foreground color is returned.

Return Value

The text color, or Black if the color could not be obtained.

Remarks

Each theme can specify a color used to draw text on each type of control, depending on the control's state. Use this method to get the color used to draw text on a specific control in a specific state.

Calling this method when visual styles are not enabled or not supported by the operating system returns Color.Empty.

See Also

ThemePaint Class | Skybound.VisualStyles Namespace