O'Reilly logo

Graphics Programming with GDI+ by Mahesh Chand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.5. Creating Owner-Drawn List Controls

How to create owner-drawn controls is a frequent topic of discussion forums and newsgroups. In this section we will discuss how an owner-drawn process works for Windows controls and how you can create your own controls.

15.5.1. The DrawItem Event

The DrawItem event is raised by owner-drawn controls. This event passes an argument of type DrawItemEventArgs, which contains data related to the event. The user uses this data to paint a specific item of the control. The properties of the DrawItemEventArgs class are given in Table 15.1.

Besides the properties listed in Table 15.1, the DrawItemEventArgs class provides two useful methods: DrawBackground and DrawFocusRectangle. The DrawBackground method draws ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required