VisualStyleHelperRender Method

Renders the visual style element of the specified class, part and state to the specified device context.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static void Render(
	string className,
	IntPtr hwnd,
	IDeviceContext dc,
	int part,
	int state,
	Rectangle bounds
)

Parameters

className  String
The class name of the visual style element.
hwnd  IntPtr
A window handle to use an instance-specific scaling or theme; otherwise, IntPtr.Zero.
dc  IDeviceContext
The device context to use for the operation.
part  Int32
An integer identifier that specifies the part to render.
state  Int32
An integer identifier that specifies the state of the part.
bounds  Rectangle
A Rectangle structure that specifies the bounds of the part to render.

Remarks

If hwnd is not IntPtr.Zero, the rendering can consider instance-specific visual style details, such as dark style or the scaling of a particular control when the application has per-monitor DPI awareness.

For className, part and state you can use the predefined nested classes of the VisualStyleElement class. For more information see also the Parts and States page.

  Note

If the size of bounds differs from the actual size of the visual element (see also GetPartSize), then the quality of the result may not be optimal. To render scaled visual style elements with high quality, use the RenderScaled method.

See Also