Click to See Complete Forum and Search --> : How do I link a icon to a executable file


kie
May 24th, 2001, 05:24 PM
Hello,
I have a icon attached to the form header. I
would like to link the same icon to the executable file. Would I need to use a API function. Any help would be much appricated.

Thanks
Karl

Tower
May 24th, 2001, 07:51 PM
I don't understand you.
In menu Project->Project Properties select Make.
In Application select icon "MyForm"
MyForm - form with your icon.

kie
May 24th, 2001, 08:46 PM
Hello,
I went to project properties and to Make tab.
The Icon displayed is the standard VB icon.
I would like to use the icon I used on the main
form on the header.

Thanks
Karl

shree
May 24th, 2001, 09:02 PM
In the make tab, next to the icon, you'll see a combo box that lists all forms on your project. Select one form. The icon of this form will be set as your application icon.

The reason you see the VB standard icon is because you have not set the icon property of the form. In the form's properties, set the Icon property to a nice-looking icon.

kie
May 25th, 2001, 05:50 AM
Hello,
Thanks for your reply. In my Form event I have
written code for run time eg.

private Sub Form_load()
Form1.icon = loadimage(app.path & "\clock.ico")
End Sub



Do I still need to set the icon at design time under Form properties to link the icon to my exe.file.
Thanks

Cimperiali
May 25th, 2001, 06:01 AM
If you change icon in runtime, changes will be visible only for runtime.
If you want to see the exe file with that icon, you have to assign the icon to a form at designed time, or compiler will not know it. Then you need to do what shree suggested:
"In the make tab, next to the icon, you'll see a combo box that lists all forms on your project. Select one form. The icon of this form will be set as your application icon."



Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.