VisualStyleRenderer.GetColor(ColorProperty) 方法

定义

返回当前视觉样式元素的指定颜色属性的值。Returns the value of the specified color property for the current visual style element.

public:
 System::Drawing::Color GetColor(System::Windows::Forms::VisualStyles::ColorProperty prop);
public System.Drawing.Color GetColor (System.Windows.Forms.VisualStyles.ColorProperty prop);
member this.GetColor : System.Windows.Forms.VisualStyles.ColorProperty -> System.Drawing.Color
Public Function GetColor (prop As ColorProperty) As Color

参数

prop
ColorProperty

ColorProperty 值之一,指定要为当前视觉样式元素检索的属性值。One of the ColorProperty values that specifies which property value to retrieve for the current visual style element.

返回

Color,它包含 prop 参数为当前视觉样式元素指定的属性的值。A Color that contains the value of the property specified by the prop parameter for the current visual style element.

例外

prop 不是 ColorProperty 值之一。prop is not one of the ColorProperty values.

注解

视觉样式使用一组颜色值来描述样式定义的元素的某些属性。Visual styles use a set of color values to describe some properties of the elements defined by a style. 这些属性由 ColorProperty 值封装。These properties are encapsulated by the ColorProperty values.

适用于