VisualStyleRenderer.GetPartSize Method (IDeviceContext, Rectangle, ThemeSizeType)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the value of the specified size property of the current visual style part using the specified drawing bounds.

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

public Size GetPartSize(
	IDeviceContext dc,
	Rectangle bounds,
	ThemeSizeType type
)

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.Size

A 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.

.NET Framework
Available since 2.0
Return to top
Show: