CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2001
    Location
    Montreal, Canada
    Posts
    29

    How do I link a icon to a executable file

    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



  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: How do I link a icon to a executable file

    I don't understand you.
    In menu Project->Project Properties select Make.
    In Application select icon "MyForm"
    MyForm - form with your icon.

    Andy Tower

  3. #3
    Join Date
    Feb 2001
    Location
    Montreal, Canada
    Posts
    29

    Re: How do I link a icon to a executable file

    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



  4. #4
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: How do I link a icon to a executable file

    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.


  5. #5
    Join Date
    Feb 2001
    Location
    Montreal, Canada
    Posts
    29

    Re: How do I link a icon to a executable file

    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


  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: How do I link a icon to a executable file

    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.
    ...at present time, using mainly Net 4.0, Vs 2010



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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured