Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing propertie on other form. [modified] Pin
RitchieRich20-Apr-08 23:48
RitchieRich20-Apr-08 23:48 
GeneralRe: Changing propertie on other form. Pin
cocoonwls22-Apr-08 18:32
cocoonwls22-Apr-08 18:32 
GeneralRender Vista Style ComboBox Pin
Lea Hayes20-Apr-08 10:03
Lea Hayes20-Apr-08 10:03 
GeneralRe: Render Vista Style ComboBox Pin
badtoto24-Dec-08 18:40
badtoto24-Dec-08 18:40 
GeneralRe: Render Vista Style ComboBox Pin
Lea Hayes26-Dec-08 8:16
Lea Hayes26-Dec-08 8:16 
Generalinsert images in rtf file Pin
panoskatws20-Apr-08 7:30
panoskatws20-Apr-08 7:30 
GeneralRe: insert images in rtf file Pin
mav.northwind20-Apr-08 7:44
mav.northwind20-Apr-08 7:44 
GeneralLoading an Icon Resource [modified] Pin
#realJSOP20-Apr-08 4:35
mve#realJSOP20-Apr-08 4:35 
I have a WinForms program in which I have added several icon resources.

I'm using the following code to load the icon resources:

Type assyType = GetType();
Icon icon = new Icon(assyType, "IconName.ico");


I'm getting the following exception:

Resource 'IconName.ico' cannot be found in class 'MyAppNamespace.Form1'.

I've also tried Type assyType = GetType("MyAppNamespace.Program"); with the same general result. I've verified that I've spelled the name of the ico correctly, so I'm kind of at a loss.

Does anyone have any ideas?

EDIT:

I've also tried this:

Icon icon = new Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MyAppNamespace.IconName.ico"));



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Sunday, April 20, 2008 10:49 AM

GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 4:50
professionalScott Dorman20-Apr-08 4:50 
GeneralRe: Loading an Icon Resource Pin
#realJSOP20-Apr-08 5:07
mve#realJSOP20-Apr-08 5:07 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 5:14
professionalScott Dorman20-Apr-08 5:14 
GeneralRe: Loading an Icon Resource Pin
#realJSOP20-Apr-08 5:41
mve#realJSOP20-Apr-08 5:41 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 6:44
professionalScott Dorman20-Apr-08 6:44 
QuestionSorting data using BindingSource.Sort Pin
Alessandra7720-Apr-08 4:04
Alessandra7720-Apr-08 4:04 
QuestionOutofMemoryException Pin
Ian Grech20-Apr-08 2:57
Ian Grech20-Apr-08 2:57 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 3:10
sitebuilderLuc Pattyn20-Apr-08 3:10 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 4:09
Jordanwb20-Apr-08 4:09 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 13:08
sitebuilderLuc Pattyn20-Apr-08 13:08 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 13:24
Jordanwb20-Apr-08 13:24 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 14:07
sitebuilderLuc Pattyn20-Apr-08 14:07 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 15:46
Jordanwb20-Apr-08 15:46 
GeneralRe: OutofMemoryException Pin
Ian Grech20-Apr-08 23:40
Ian Grech20-Apr-08 23:40 
GeneralRe: OutofMemoryException Pin
Ian Grech22-Apr-08 22:14
Ian Grech22-Apr-08 22:14 
AnswerRe: OutofMemoryException Pin
Ian Grech28-Apr-08 10:52
Ian Grech28-Apr-08 10:52 
GeneralRe: OutofMemoryException Pin
Scott Dorman20-Apr-08 4:42
professionalScott Dorman20-Apr-08 4:42 

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.