VisualStyleRenderer.GetPartSize Method (IDeviceContext, Rectangle, ThemeSizeType)
Returns the value of the specified size property of the current visual style part using the specified drawing bounds.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- dc
- Type: System.Drawing.IDeviceContext
The IDeviceContext this operation will use.
- bounds
- Type: System.Drawing.Rectangle
A Rectangle that contains the area in which the part will be drawn.
- type
- Type: System.Windows.Forms.VisualStyles.ThemeSizeType
One of the ThemeSizeType values that specifies which size value to retrieve for the part.
Return Value
Type: System.Drawing.SizeA Size that contains the size specified by the type parameter for the current visual style part.
| Exception | Condition |
|---|---|
| ArgumentNullException | dc is null. |
| InvalidEnumArgumentException | prop is not one of the ThemeSizeType values. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.