VisualStyleRenderer.GetMargins(IDeviceContext, MarginProperty) 方法

定义

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

public:
 System::Windows::Forms::Padding GetMargins(System::Drawing::IDeviceContext ^ dc, System::Windows::Forms::VisualStyles::MarginProperty prop);
public System.Windows.Forms.Padding GetMargins (System.Drawing.IDeviceContext dc, System.Windows.Forms.VisualStyles.MarginProperty prop);
member this.GetMargins : System.Drawing.IDeviceContext * System.Windows.Forms.VisualStyles.MarginProperty -> System.Windows.Forms.Padding
Public Function GetMargins (dc As IDeviceContext, prop As MarginProperty) As Padding

参数

dc
IDeviceContext

此操作将使用的 IDeviceContextThe IDeviceContext this operation will use.

prop
MarginProperty

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

返回

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

异常

dcnulldc is null.

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

注解

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

适用于