Hai all,

i have created a project in visual basic 6 and i made the exe file by clicking the command in file menu " Make Exe ........". but the icon represents like a form. i wnat to change this icon to my own. how can i change it. is it possible?

hope a +ve reply

thankz

vijesh

Dani AI

Generated

pointed you in the right direction for the form/title-bar icon. For everyone asking specifically about the EXE’s icon (, , ), VB6 sets that at compile time and it is not something you change with code at runtime.

Try this workflow:

  1. Create a single .ico that contains multiple sizes (at least 16x16 and 32x32; add 48x48 for older XP views and 256x256 if you want crisp icons on newer Windows).
  2. In VB6, open the form you like and set its Icon property to that .ico (this is what @Comatose described).
  3. Tell VB6 to use that form’s icon for the compiled EXE: Project -> Project Properties -> General tab -> Icon dropdown -> pick the form that has your icon.
  4. Make the EXE again (File -> Make YourProject.exe). The .ico is embedded; you do not need to ship the .ico file.

Notes and gotchas:

  • If your Startup Object is Sub Main, you can still choose any form in Project Properties purely to supply the application icon. That form does not need to be shown.
  • If Windows still shows the old icon, it is usually icon cache. Bump the file version in Project Properties -> Make tab or change the EXE filename, then rebuild. As a last resort, clear the Explorer icon cache and log off/on.
  • Changing an already-built EXE’s icon without recompiling requires a resource editor and will modify the binary (and break any digital signature). Rebuilding is the safer route.

This should cover both the window/tray icon and the Explorer/desktop icon the thread was aiming to solve.

Recommended Answers

All 7 Replies

In the properties toolbox on the left (by default) find the "icon" property, and change it to the path and filename of the .ICO file you want to use....

In the properties toolbox on the left (by default) find the "icon" property, and change it to the path and filename of the .ICO file you want to use....

thanks for ur reply

its working

with luv
vijesh

can u give me the solved code to change the icon of .exe file>

Please help me, i have created exe in vb6 but i have to change the icon of exe file.

sharif, boya, both of you need to read this thread as your answer is contained within, and on future inquiries, let it be known to both of you that raising the dead is looked down upon around most forums. If you need to reference an older thread, then copy its url into a thread of your own making....

Good Luck

i want to download a portable microsoft office frontpage but I can't find any source of the web...

vb5prgrmr, their question has not been answered and it is the same question that I have.

1) I already have an icon for the window tray and at the taxt bar on the top of the file

2) I want to add an icon of the exe file as sharif and boya want to do. How is this accomplished?

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.