Version

ColorFromString(String,Color,Boolean) Method

Returns a Color value from the specified text.
Syntax
'Declaration
 
Public Overloads Shared Function ColorFromString( _
   ByVal text As String, _
   ByVal original As Color, _
   ByVal allowEmpty As Boolean _
) As Color
public static Color ColorFromString( 
   string text,
   Color original,
   bool allowEmpty
)

Parameters

text
String to convert
original
Default value in case of failure
allowEmpty
Determines whether clearing the edit portion results in the value reverting to Color.Empty. If false, the editor's value reverts to the value of the DefaultColor property.

Return Value

A Color based on the specified text, or the original color if the string cannot be parsed.
Remarks

In the case where an empty string is specified in the 'text' parameter, Color.Empty is returned.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also