Control Appearance and Behavior

A control’s appearance is set via the same set of basic properties used to control form appearance: items such as ForeColor, BackColor, and Font all make an appearance on most controls.

Visual Styles

One item of interest is the capability for a control to automatically alter its appearance to conform to the currently selected “Desktop Theme” if it’s running on Windows XP, Windows Vista, or Windows 7. This capability is enabled by a call to the Application.Enable VisualStyles method. This line of code is automatically included for you by default as the first line in the Main method. This location is ideal because it must be called before the controls in the application are actually created. If you remove the call, ...

Get Microsoft® Visual Studio® 2010 Unleashed 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.