Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
GeneralRe: LZW compression using C# Pin
Heath Stewart1-Jun-04 11:07
protectorHeath Stewart1-Jun-04 11:07 
GeneralRe: LZW compression using C# Pin
flipdoubt1-Jun-04 11:09
flipdoubt1-Jun-04 11:09 
GeneralRe: LZW compression using C# Pin
Heath Stewart1-Jun-04 11:13
protectorHeath Stewart1-Jun-04 11:13 
GeneralRe: LZW compression using C# Pin
flipdoubt1-Jun-04 11:31
flipdoubt1-Jun-04 11:31 
GeneralIFormatProvider on DataGridTextColumn Pin
Anfernius1-Jun-04 8:46
Anfernius1-Jun-04 8:46 
GeneralRe: IFormatProvider on DataGridTextColumn Pin
Heath Stewart1-Jun-04 8:53
protectorHeath Stewart1-Jun-04 8:53 
GeneralRetreiving Application Icon Pin
ThisBytes51-Jun-04 8:43
ThisBytes51-Jun-04 8:43 
GeneralRe: Retreiving Application Icon Pin
Heath Stewart1-Jun-04 9:09
protectorHeath Stewart1-Jun-04 9:09 
App.ico, the default icon for a project, isn't built as an embedded resource by default. It is used as the Win32 icon when your assembly is built and is embedded into the resource section of the PE/COFF executable (in the .rsrc section). When this icon is assigned to the main Form, it is actually embedded in a ResX file using base64 encoding (this gets compiled to a .resources file and embedded into the assembly).

You can either set this as an embedded resource by selecting the icon, going to the properties window, and set the Build Action to Embedded Resource. You can't just use App.ico, however. You must prefix it with the root namespace for your project, which is the name of the project by default. A better way so you don't have to remember this is to use the overloaded constructor for the Icon class using the main Form to get the namespace like so:
Icon ico = new Icon(typeof(MyForm), "App.ico");
The other way without having to embed the icon as a manifest resource is to P/Invoke the necessary Windows APIs to extract icons from the executable, like LoadImage. This can lead to a lot of extra work, however.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Retreiving Application Icon Pin
ThisBytes51-Jun-04 9:33
ThisBytes51-Jun-04 9:33 
GeneralRe: Retreiving Application Icon Pin
Heath Stewart1-Jun-04 9:36
protectorHeath Stewart1-Jun-04 9:36 
GeneralCustom Control Design Time Problem Pin
Z.D.Biles1-Jun-04 8:40
Z.D.Biles1-Jun-04 8:40 
GeneralRe: Custom Control Design Time Problem Pin
Heath Stewart1-Jun-04 8:59
protectorHeath Stewart1-Jun-04 8:59 
GeneralRe: Custom Control Design Time Problem Pin
Z.D.Biles1-Jun-04 9:46
Z.D.Biles1-Jun-04 9:46 
Generalsystem language Pin
orcun colak1-Jun-04 7:45
orcun colak1-Jun-04 7:45 
GeneralRe: system language Pin
Heath Stewart1-Jun-04 8:55
protectorHeath Stewart1-Jun-04 8:55 
QuestionDataSet Pointer? Pin
Adam °Wimsatt1-Jun-04 7:27
Adam °Wimsatt1-Jun-04 7:27 
AnswerRe: DataSet Pointer? Pin
Heath Stewart1-Jun-04 8:51
protectorHeath Stewart1-Jun-04 8:51 
AnswerRe: DataSet Pointer? Pin
Anfernius1-Jun-04 8:51
Anfernius1-Jun-04 8:51 
AnswerRe: DataSet Pointer? Pin
LongRange.Shooter1-Jun-04 8:59
LongRange.Shooter1-Jun-04 8:59 
GeneralXML Serializing a Color Pin
Joel Holdsworth1-Jun-04 7:26
Joel Holdsworth1-Jun-04 7:26 
GeneralRe: XML Serializing a Color Pin
leppie1-Jun-04 8:32
leppie1-Jun-04 8:32 
GeneralRe: XML Serializing a Color Pin
Joel Holdsworth1-Jun-04 10:38
Joel Holdsworth1-Jun-04 10:38 
GeneralFloating Toolbar Pin
maxbale1-Jun-04 7:21
maxbale1-Jun-04 7:21 
Generalupgrading to 2003 - problems with reports Pin
econnor1-Jun-04 6:19
econnor1-Jun-04 6:19 
GeneralRe: upgrading to 2003 - problems with reports Pin
LongRange.Shooter1-Jun-04 6:39
LongRange.Shooter1-Jun-04 6:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.