13.3. Understanding the SetStyle Method

Windows Forms and controls provide built-in support for double buffering, and the SetStyle method of the Control class plays a vital role in this process. Before we discuss how to use SetStyle, let’s take a look at this method and its members.

The SetStyle method is defined in System.Windows.Forms.Control, which sets the specified style of a control. This method takes two arguments. The first argument is of type ControlStyle enumeration, and it represents the style of the control. The second argument is true if we want to apply the specified style, false otherwise. The members of the ControlStyle enumeration are described in Table 13.1.

Table 13.1. ControlStyle members
MemberDescription
AllPaintingInWmPaint ...

Get Graphics Programming with GDI+ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.