This documentation is archived and is not being maintained.

VisualStyleRenderer.GetMargins Method

Returns the value of the specified margins property for the current visual style element.

Namespace: System.Windows.Forms.VisualStyles
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public Padding GetMargins (
	IDeviceContext dc,
	MarginProperty prop
)
public Padding GetMargins (
	IDeviceContext dc, 
	MarginProperty prop
)
public function GetMargins (
	dc : IDeviceContext, 
	prop : MarginProperty
) : Padding
Not applicable.

Parameters

dc

The IDeviceContext this operation will use.

prop

One of the MarginProperty values that specifies which property value to retrieve for the current visual style element.

Return Value

A Padding that contains the value of the property specified by the prop parameter for the current visual style element.

Exception typeCondition

ArgumentNullException

dc is a null reference (Nothing in Visual Basic).

InvalidEnumArgumentException

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. These properties are encapsulated by the MarginProperty values.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: