Page 1 of 1

CommandButton no image after compilation

Posted: 25 Sep 2009, 11:10
by Mex
When i set hImageList then in debug mode button icon is shown correctly, but after compilation image is not visible.

Re: CommandButton no image after compilation

Posted: 25 Sep 2009, 15:08
by TiKu
Hi,

the hImageList property requires comctl32.dll 6.0, so make sure you provide a manifest file for your binary and that you're running the program on Windows XP or newer. Also have a look at the "Events" sample.

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 11:11
by Mex
Still have problems with button image under Windows 7. Button image is not displayed.
Is't possible that, comctl32.dll on Windows 7 is lower as ver. 6 or there are somehow two different versions?


BR:
Meelis

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 11:30
by TiKu
The button is themed, so it definitly uses comctl32.dll 6. Does it work on Vista? Are the button images in the "Events" sample displayed?

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 12:05
by Mex
In Events sample all is working fine, also is image displayer correctly with Vista.

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 12:46
by TiKu
Okay, so how do you attach the image list to the button? And how do you create and fill the image list?

If you save the button's properties to a file (it can be done via the property pages) and post this file here, I can also tell you whether the problem is caused by a specific setting.

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 13:45
by Mex
I think this problem is related to VB's Common Controls. I installed on Windows 7 http://www.microsoft.com/downloads/deta ... laylang=en
and now it works fine.

Im setting hImageList property in Form_Load event - btnPrintTicket.hImageList = theImageList.hImageList

Meelis

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 13:57
by TiKu
Ah, so you use the ImageList control from the VB Common Controls? I always use API-generated image lists, because the VB control can't handle 32 bit icons.

Re: CommandButton no image after compilation

Posted: 28 Sep 2009, 13:58
by Mex
Ok, now im smarter, in the future i use ImageList_Create API, even when i use 24 bit icons :)