PDA

Click to See Complete Forum and Search --> : Program Icon


john tindell
Jul 5th, 2004, 07:18 AM
Hey how do i set the icon on a form?

i found this

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

csc /r:Interface/Interface.dll /t:winexe /win32icon:parent.ico parent.cs



Thanks

brown monkey
Jul 5th, 2004, 09:14 PM
this?

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

Pirate
Jul 6th, 2004, 09:12 PM
Originally posted by john tindell
Hey how do i set the icon on a form?

i found this

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 .