Files
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.3 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Use a Control Rendering Class 03/30/2017
csharp
vb
cpp
professional appearance [Windows Forms], rendering Windows Forms controls
visual themes [Windows Forms], applying to Windows Forms controls
visual styles [Windows Forms], rendering Windows Forms controls
c0125e34-cd74-4c35-818c-3e40f462b0a3

How to: Use a Control Rendering Class

This example demonstrates how to use the xref:System.Windows.Forms.ComboBoxRenderer class to render the drop-down arrow of a combo box control. The example consists of the xref:System.Windows.Forms.Control.OnPaint%2A method of a simple custom control. The xref:System.Windows.Forms.ComboBoxRenderer.IsSupported%2A?displayProperty=nameWithType property is used to determine whether visual styles are enabled in the client area of application windows. If visual styles are active, then the xref:System.Windows.Forms.ComboBoxRenderer.DrawDropDownButton%2A?displayProperty=nameWithType method will render the drop-down arrow with visual styles; otherwise, the xref:System.Windows.Forms.ControlPaint.DrawComboButton%2A?displayProperty=nameWithType method will render the drop-down arrow in the classic Windows style.

Example

[!code-cppSystem.Windows.Forms_ControlRenderer#10] [!code-csharpSystem.Windows.Forms_ControlRenderer#10] [!code-vbSystem.Windows.Forms_ControlRenderer#10]

Compiling the Code

This example requires:

See also