Color.IsNamedColor Color.IsNamedColor Color.IsNamedColor Color.IsNamedColor Property

定义

获取指示此 Color 结构是命名颜色还是 KnownColor 枚举成员的值。Gets a value indicating whether this Color structure is a named color or a member of the KnownColor enumeration.

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

属性值

如果此 Color 是使用 FromName(String) 方法或 FromKnownColor(KnownColor) 方法创建的,则为 true;否则为 falsetrue if this Color was created 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. 因此,当IsNamedColor属性应用于Color通过使用创建结构FromArgb方法,IsNamedColor返回false,即使与 ARGB 值匹配的预定义的颜色的 ARGB 值。Therefore, when the IsNamedColor property is applied to a Color structure that is created by using the FromArgb method, IsNamedColor returns false, even if the ARGB value matches the ARGB value of a predefined color.

适用于