VisualStyleHelperRender Method
Renders the visual style element of the specified class, part and state to the specified device context.
Namespace: KGySoft.WinFormsAssembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
public static void Render(
string className,
IntPtr hwnd,
IDeviceContext dc,
int part,
int state,
Rectangle bounds
)
Public Shared Sub Render (
className As String,
hwnd As IntPtr,
dc As IDeviceContext,
part As Integer,
state As Integer,
bounds As Rectangle
)
public:
static void Render(
String^ className,
IntPtr hwnd,
IDeviceContext^ dc,
int part,
int state,
Rectangle bounds
)
static member Render :
className : string *
hwnd : IntPtr *
dc : IDeviceContext *
part : int *
state : int *
bounds : Rectangle -> unit
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.
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.
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.