Results 1 to 3 of 3

Thread: Program Icon

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Program Icon

    Hey how do i set the icon on a form?

    i found this
    Code:
    System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(parent));
    this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.icon")));
    But i dont understand it and it doesnt work.

    Heres how im compiling it
    Code:
    csc /r:Interface/Interface.dll /t:winexe /win32icon:parent.ico parent.cs

    Thanks

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    this?
    PHP Code:
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    public class 
    SampleForm:Form{
        public 
    SampleForm(){
            
    this.Icon=new Icon("brownmonkey.ico");
        }
        static 
    void Main(){
            
    Application.Run(new SampleForm());
        }

    just... csc SampleForm.cs

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Program Icon

    Originally posted by john tindell
    Hey how do i set the icon on a form?

    i found this
    Code:
    System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(parent));
    this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.icon")));
    But i dont understand it and it doesnt work.
    This code , gets embedded icon .
    Last edited by Pirate; Jul 6th, 2004 at 09:18 PM.

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