Dear Sir/Madam,

As I have seen VB 6.0 is supporting Icon files, Metafiles and BMP files for using in the PictureBox property of ImageBox, PictureBox, and CommandButton.

I have tried ICON file to use on those Controls, but some ICON files are supported and some are not supported. So, I am confused, because all that files are ICON files.

I want to know, which format of ICON files are supported and which are not supported and how I will identify those ICON files?

Can we use PNG file in VB 6.0 ?

Dani AI

Generated

the reason some .ICO files work and others do not is that .ico is a container. VB6’s Picture/Image/CommandButton use the old OLE StdPicture decoder, which understands the classic BMP-based icon frames used in the 90s/early 2000s. Many newer icons bundle 32-bit images with an alpha channel and even 256x256 frames stored as PNG (introduced with Vista). Those modern frames are fine for Windows Explorer, but StdPicture does not handle them, so VB6 reports “Invalid picture” unless the .ico also contains older 16x16/32x32/48x48, non‑alpha frames it can fall back to. See Microsoft’s icon size guidance and the Vista-era PNG-in-ICO change for context: Icons (Design basics) and Introducing Windows Vista Icons.

What works reliably in VB6: create or convert icons that include 16x16 and 32x32 (optionally 48x48) images at 4‑bit (16 colors), 8‑bit (256 colors), or 24‑bit true color with no alpha. Avoid 256x256 entries and strip any PNG‑compressed or 32‑bit ARGB frames. That aligns with what observed about dimensions, and is right that .ICO/.CUR are the native types; just remember that cursors are for cursor properties, not general pictures.

On formats: VB6’s LoadPicture recognizes BMP, ICO, CUR, RLE, WMF/EMF, GIF, and JPEG. PNG is not on that list, so it is not natively supported in standard controls. If you must use PNG (or 32‑bit icons with alpha), load them through GDI+ and hand the result to a StdPicture; here is a well-known VB6 example showing how to do that with GDI+: Loading images with GDI+. For reference, Microsoft documents the formats LoadPicture understands in its VB family docs: LoadPicture function.

Recommended Answers

All 5 Replies

Hi P.manidas,

I use icon created by microangelo icon creator and its Setup File Name is 'mt610-10-1-eval'. You can download this file from internet using Google etc.
VB support 256 Colors with 48X48 or 32x32 or 16x16 dimensions.

Hope this helps

all icon files comes with .ICO extension. You may also able to use .CUR (Cursor files) also.

Dear all Sir/Madam,

Thank you for your valuable reply.

Hi P.manidas,
Please mark Resolved if your problem is solved. So that Helpers will not spend their time reading this thread and those who need help with same problem can solve their problem by reading this thread.
Thankx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.