views:

376

answers:

2

I'm developing an ActiveX control which (these days) is used mostly in WinForms apps.

The ActiveX control has a 'property page' dialog, which can be shown programmatically using the ShowPropertyPages method on the AxHost class. This is the custom UI that can be brought up in Visual Studio to edit a control's properties.

This property page dialog contains a ListBox control which uses an ImageList to display icons next to list items. These icons are 32-bit alpha-blended bitmaps. In order for these to display properly, version 6.0 or above of COMCTL32.DLL must be used.

Unfortunately when I run my WinForms app, it loads and uses COMCTL32.DLL version 5.xxx. As a result, when the property page dialog is displayed the icons look bad (the semi-transparent areas are drawn in solid black).

My question is: is there any way I can make sure to use COMCTL32.dll version 6.0+ from within the ActiveX control's property page UI, regardless of what the process is using? Or can I force the host process to use version 6.0? (I think not, because I am thinking the host process might have already loaded COMCTL32.DLL into memory before any of the code in the ActiveX control.

This webpage covers some scenarios for using COMCTL32 6.0, but not the situation I am in.

A: 

If your application calls Application.EnableVisualStyles() (typically before calling Application.Run() to start a message loop) then version 6+ of the common controls library should be used.

Arnshea
Yeah, I read this elsewhere. It does, and they aren't. Weird!
mackenir
+2  A: 
mackenir