I am having trouble setting an icon in my project for my form.
What size does it have to be?
Also, where on the net are there free icons that work in vb6? Most i have tried are invalid...
Printable View
I am having trouble setting an icon in my project for my form.
What size does it have to be?
Also, where on the net are there free icons that work in vb6? Most i have tried are invalid...
If you have C++, you can make your own icons. It has to be an Icon file. Not any picture will do.
I'm not exactly sure what size it has to be, but it just needs to be a ".ico" file.
Check out http://iconarchive.com if you haven't already. :)
I keep getting an 'Invalid picture' error when i try any of the icons... even the ones off http://iconarchive.com
Hmmm... what size icons are you using?
are u doing it in the picutre property?
nope, in the icon propertyQuote:
are u doing it in the picutre property?
Im not sure what size, how do i find that out?
Right click the icon file and click properties to find out the size. :)
48 x 48, 16 x 16, 256 x 256... none work
Could you try the icon I have attached? It has worked with me on a few programs in a series I made. Let me know how it goes.
So u are using this property on the form right?
arcticfang: that works...
Simon Canning, what icon are u trying to use?
Try this: http://www.canning.co.nz/Calander.ico
Does it work?
can u upload it please?
well, i can get it to look like this..... but that is about all i can do. If you want it, just download the NewFolder.zip file i attached. Just upload the file into the project and it will work.
I have heaps of png files that i want to convert to icons... what software do you recommend... i tried Imagicon 3.4 free download... but the resolution is so poor.
as VB6 is so old, it is very fussy about what icons it supports... for details see the article What picture types does VB support? (or: why wont VB load this picture/icon?) from our Classic VB FAQs (in the FAQ forum)
In terms of software to convert (or create) icons, the best I have ever seen is IcoFX, which is completely free.
If you want to use a nice alpha blended icon for your form, you can do that at runtime. This posting has sample code on how that can be done
I used C++ to convert it to an icon file that VB could use. The only thing that i cant figure out why it changes the color of the icon i use. Its weird. O_o
your icon maybe have resolution high than 48 x 48 or resolution higher than 256px
As stated in the FAQ I linked to, 48x48 is not supported by VB, and more than 256 colours is (but only 24 bit, not 32 bit).
SI, bit depth is of utmost importance I agree. But VB can actually handle almost any size icon less than 256. It won't error on a 256x256 icon, but it won't display it. Here are a couple to play with if anyone wants to validate.
Edited: I think VB actually treats a 256x256 icon as a 0x0 icon. When loaded into an image control, the image control shrinks to 1x1 (vb doesn't allow 0x0 controls in design time) and is understandable since the internal icon structure has a 256 icon width/height as zero. But those that process icon structures interpret zero to mean 256; just not VB ;)
Simon, as mentioned by SI, 32bit icons are not supported by VB. All 3 of your icons are 32bit. I gave you a link in post #19 that has sample code that allows you to use APIs to load and set the icon to your form's window (window icon). That will work for XP & above.
it must be true type and the size is 32 -....16x16..you can use iconfx for resizing it,just search it on google..
hope it helps..
but if it so then please rate me coz i am out of reputation..
That is not correct. It does not have to be "true type". VB icons can be 1, 4, 8, 16, 24 bits per pixel and in sizes ranging from 1 to 255.
32 bit icons can be drawn & assigned to windows using APIs on operating systems that support them. 32 bit icons cannot be assigned to a VB picture or icon property via LoadPicture().
ty for the correction..
k, thanks guys.
Im using, and it is working out really well for me.. thanksQuote:
IcoFX