语言

VisualStyleRenderer.GetMargins(IDeviceContext, MarginProperty) 方法

定义

返回当前视觉样式元素的指定边距属性的值。

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

此操作 IDeviceContext 将使用。

prop
MarginProperty

指定要 MarginProperty 为当前视觉样式元素检索哪些属性值的值之一。

返回

包含由当前视觉样式元素的参数指定的Padding属性值的 Aprop。

例外

dc 是 null。

prop 不是值 MarginProperty 之一。

注解

视觉样式使用一组边距值来描述样式定义的元素的某些属性。 这些属性由 MarginProperty 值封装。

适用于