Compile app with icons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Reizlein

    Compile app with icons

    How can i compile my application with more than 1 icon ? i have tryied
    adding external .ico to the solution and settign them to content or resource
    but then they are not visible as normal icons of the file, just the primary
    one is.

    I need my app to include 3 icons in its .exe so i can use them in explorer
    extensions for windows.

    Thanks,
    Christian

  • David Glienna

    #2
    Re: Compile app with icons

    You can add an icon to each form, or use a resource file to load into an
    image control.

    --
    David Glienna
    MVP - Visual Developer (Visual Basic)
    2006 thru 2008
    "Christian Reizlein" <creizlein@hotm ail.comwrote in message
    news:75249E21-221D-4198-9E61-FFBEC4BBD66D@mi crosoft.com...
    How can i compile my application with more than 1 icon ? i have tryied
    adding external .ico to the solution and settign them to content or
    resource but then they are not visible as normal icons of the file, just
    the primary one is.
    >
    I need my app to include 3 icons in its .exe so i can use them in explorer
    extensions for windows.
    >
    Thanks,
    Christian

    Comment

    • Bill McCarthy

      #3
      Re: Compile app with icons

      Hi Christian,

      VB doesn't expose this as such (at least not that I know of). If you aren't
      singing your app, you can modify the app's Win32 resource file by opening
      the exe in Visual Studio (you may need to have C++ instaleld for that, not
      sure). Generally though, that's a real pain in the .... you know where ...
      <g>, so what I do is use a satellite dll or multiples of as native resource
      dlls as opposed to managed resource dll's.





      "Christian Reizlein" <creizlein@hotm ail.comwrote in message
      news:75249E21-221D-4198-9E61-FFBEC4BBD66D@mi crosoft.com...
      How can i compile my application with more than 1 icon ? i have tryied
      adding external .ico to the solution and settign them to content or
      resource but then they are not visible as normal icons of the file, just
      the primary one is.
      >
      I need my app to include 3 icons in its .exe so i can use them in explorer
      extensions for windows.
      >
      Thanks,
      Christian

      Comment

      • =?Utf-8?B?QU1lcmNlcg==?=

        #4
        RE: Compile app with icons

        How can i compile my application with more than 1 icon ? i have tryied
        adding external .ico to the solution and settign them to content or resource
        but then they are not visible as normal icons of the file, just the primary
        one is.
        >
        I need my app to include 3 icons in its .exe so i can use them in explorer
        extensions for windows.
        This may be possible with vs 2005 project resources, but I don't know
        anything about that.

        The way I do it is from vs 2003 (and I still use it in vs2005) is as follows.

        1. Add the .ico files to your project (Project, Add Existing Item).
        2. For each file, set its Build Action to Embedded Resource (select the
        file, look in the Properties window).
        3. Access the icon as in the code below. If you added "lighton.ic o", use

        Dim s As String = Application.Pro ductName & ".lighton.i co"
        Icon = New
        Icon(Reflection .Assembly.GetEx ecutingAssembly .GetManifestRes ourceStream(s))

        Comment

        Working...