Color.IsKnownColor Color.IsKnownColor Color.IsKnownColor Color.IsKnownColor Property

定义

获取指示此 Color 结构是否为预定义颜色的值。Gets a value indicating whether this Color structure is a predefined color. 预定义颜色由 KnownColor 枚举的元素表示。Predefined colors are represented by the elements of the KnownColor enumeration.

public:
 property bool IsKnownColor { bool get(); };
public bool IsKnownColor { get; }
member this.IsKnownColor : bool
Public ReadOnly Property IsKnownColor As Boolean

属性值

如果此 Color 是使用 FromName(String) 方法或 FromKnownColor(KnownColor) 方法基于预定义颜色创建的,为 true;否则为 falsetrue if this Color was created from a predefined color by using either the FromName(String) method or the FromKnownColor(KnownColor) method; otherwise, false.

注解

此属性不会进行比较的 ARGB 值。This property does not do a comparison of the ARGB values. 因此,当IsKnownColor属性应用于Color通过使用创建结构FromArgb方法,IsKnownColor返回false,即使与 ARGB 值匹配的预定义的颜色的 ARGB 值。Therefore, when the IsKnownColor property is applied to a Color structure that is created by using the FromArgb method, IsKnownColor returns false, even if the ARGB value matches the ARGB value of a predefined color.

适用于