Howto: Enable Visual Styles in a VS2003 plugin or add-in

Tuesday, December 19, 2006 0 Comments

When you want to give XP visual style to a .NET application, you must call Application.EnableVisualStyles() method. But an additional call is needed, because a Framework bug. Some images in common controls under a ListView, are not shown. To avoid this bug you must use Application.DoEvents() after enable visual styles.

This is easy when you are developing a Windows standard application. But when you are developing a Visual Studio add-in (Visual Studio 2003) or a Office add-in, the perspective is different.

EnableVisualStyles is not compatible with Visual Studio 2003. It causes some crashes in the application. To enable XP visual styles, without affecting other applications, you can define an activation context, and the the XP themes affect only the appearance of your code.

Here, there is more info about XP visual styles:

We develop Plastic SCM, a version control that excels in branching and merging, can deal with huge projects and big binary assets natively, and it comes with GUIs and tools to make everything simpler.

If you want to give it a try, download it from here.

We are also the developers of SemanticMerge, and the gmaster Git client.

0 comentarios: