Results 1 to 2 of 2

Thread: Change Icons dynamically

  1. #1

    Thread Starter
    Banned
    Join Date
    Apr 2018
    Location
    https://t.me/pump_upp
    Posts
    79

    Question Change Icons dynamically

    My application has a copy of another application.exe (my own creation) in the resources. With a button click, my application will create a new copy of the .exe in my.resources.
    Code:
    IO.File.WriteAllBytes(path, My.Resources.My.exe)
    I am also obtaining an .ico from an image:
    Code:
                    Dim Ico As Icon
                    Dim bmp As Bitmap = Image.FromFile(DisabledDir & itm.Text & "\icon.png")
                    Ico = Icon.FromHandle(bmp.GetHicon)
    The question is: Is it possible to change the icon of the .exe file either before or after creating the new file.

    Thank you for your responses.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Change Icons dynamically

    That depends on what you mean by "the icon of the EXE". If you have compiled an icon into that executable then no, you can't change that, because it's compiled. If you mean that icon used for a shortcut to that executable then sure, because that shortcut is something that you are creating from scratch.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

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