Disabling windows themes for controls


In this short example I demonstrated how you could improve the default theme of tree and listview controls to incorporate the Vista ‘look and feel’. It is also useful to disable this for example, you may want to remove the look of the month calendar (shown) or date timer picker controls. In Vista both controls are drawn with this styling.

CalendarEnabled 

In office type applications you might prefer a control that has the same theme as the rest of the application, for example, this is my outlook calendar.

Outlook

In order to get the native calendar you need to follow the example but set the windows theme to empty strings (everything else is the same).

C#

SetWindowTheme(monthCalendar1.Handle, string.Empty, string.Empty); 

VB

SetWindowTheme(monthCalendar1.Handle, String.Empty, String.Empty)

You will now have the default control, that you can override and change.

CalendarDisabled

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s