vnarod Posted August 27, 2002 Posted August 27, 2002 I need to change Form Icon during run-time. Where can I store icons? I don't want to keep them as separate files and ImageList stores them in Picture format that is incompatible with Icon format. Quote
*Gurus* divil Posted August 27, 2002 *Gurus* Posted August 27, 2002 Add them to your project, and mark their Build Action as "Embedded Resource". Then you can get them with Assembly.GetManifestResourceStream() at runtime. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
vnarod Posted August 29, 2002 Author Posted August 29, 2002 I am not sure how to use it. There is no samples in help. I tried fm.Icon = System.Reflection.Assembly.GetManifestResourceStream("explorer.ico") but it gives an error. Can you show me an example,please? Quote
*Gurus* divil Posted August 30, 2002 *Gurus* Posted August 30, 2002 fm.Icon = New Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyNameSpace.explorer.ico")) Check your root namespace by going in to project properties, and that should work ok. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
TechnoTone Posted January 23, 2003 Posted January 23, 2003 Add them to your project, and mark their Build Action as "Embedded Resource". Am I being a bit thick? I can't see how to do this. :confused: :confused: Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted January 23, 2003 *Gurus* Posted January 23, 2003 Right button on project, Add Existing Item. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
TechnoTone Posted January 24, 2003 Posted January 24, 2003 (edited) Sorry - I should've been clearer. How do I mark the Build Action as "Embedded Resource"? Edit: DOH!!! I was definitely being a bit thick. Found it in the property window. Edited January 24, 2003 by TechnoTone Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.