#1
  1. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12

    Angry Form icon doesn't work


    I added an icon to my project and set it to "embedded resource". I'm use the following code for my main():

    Code:
    static void Main()
           {
               MainForm form = new MainForm();
    
               System.Reflection.Assembly assembly = form.GetType().Assembly;
               System.IO.Stream iconStream = assembly.GetManifestResourceStream("Client.Clnt.ico");
               System.Drawing.Icon resourceIcon = new Icon(iconStream);
               form.Icon = resourceIcon;
    
               Application.Run(form);
           }
    And it compiles just fine. However, when i run it, the form's icon is that default document one with the grey square in it. Also, the icon doesn't show up when I open the executable in Resource Hacker. Any suggestions? Thanks!
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  2. #2
  3. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    Oh, and I'm writing this with C# in Visual Studio .NET 2002. Sorry about forgetting that
    Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.

    May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.

    To the systems programmer, users and applications serve only to provide a test load.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    3
    Rep Power
    0
    you might want to try putting two .'s instead of just the one. (i'm not 100% sure if strings can handle .'s without a / in front of em or whatever, either)

    other than that, i see nothing wrong with your code.

IMN logo majestic logo threadwatch logo seochat tools logo