Click here to Skip to main content
15,917,329 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: hoe to search particular file in folder under drives Pin
Eduard Keilholz25-Mar-08 21:16
Eduard Keilholz25-Mar-08 21:16 
GeneralMake Money From My Computer Program Pin
hosdfiadsf18-Mar-08 16:40
hosdfiadsf18-Mar-08 16:40 
GeneralRe: Make Money From My Computer Program Pin
Christian Graus18-Mar-08 20:36
protectorChristian Graus18-Mar-08 20:36 
GeneralRe: Make Money From My Computer Program Pin
Brady Kelly21-Mar-08 23:50
Brady Kelly21-Mar-08 23:50 
GeneralRe: Make Money From My Computer Program Pin
hosdfiadsf22-Mar-08 3:56
hosdfiadsf22-Mar-08 3:56 
GeneralRe: Make Money From My Computer Program Pin
Luis Alonso Ramos30-Mar-08 15:44
Luis Alonso Ramos30-Mar-08 15:44 
QuestionFrom Form to DLL - How Do I Package Resource Icons and Files? Pin
Tom91118-Mar-08 7:19
Tom91118-Mar-08 7:19 
GeneralRe: From Form to DLL - How Do I Package Resource Icons and Files? Pin
Aurelius166420-Mar-08 5:38
Aurelius166420-Mar-08 5:38 
If you add a resource file controled by .net you can access the images in code using the resource file name. For example if you add an image (MyImage.jpg) to a resource file (MyResources.resx) you will be able to access it like below (check your compiler warnings and click enable strongly typed resources if you see it).

Image myImage = MyResource.MyImage;

However, I suspect you may be having problems with the namespaces of your code. To access resources you must correctly know the namespace. You can embed resources just like you mentioned by changing the build options in properties. If you do this you would need to do the following to access the image. Note that the resource name includes the full namespace which will by default include any sub folders used to store the image.

Assembly assemblyExecuting;<br />
Stream streamImage;<br />
Image imageMine<br />
<br />
assemblyExecuting = Assembly.GetExecutingAssembly();<br />
streamImage = assemblyExecuting.GetManifestResourceStream("MyNameSpace.Folder.FileName.jpg");<br />
imageMine = Image.FromStream(streamImage);<br />
streamImage.Close();



QuestionHow to populate datas in a Datagridview comboboxcolumn? Pin
kssknov18-Mar-08 2:37
kssknov18-Mar-08 2:37 
GeneralRe: How to populate datas in a Datagridview comboboxcolumn? Pin
Herman<T>.Instance1-Apr-08 23:42
Herman<T>.Instance1-Apr-08 23:42 
QuestionShare MSDN in LAN Pin
Sachin Pimpale18-Mar-08 0:44
Sachin Pimpale18-Mar-08 0:44 
Generaldatagrid or dataset to excel file Pin
caradri17-Mar-08 3:39
caradri17-Mar-08 3:39 
GeneralRe: datagrid or dataset to excel file Pin
Giorgi Dalakishvili17-Mar-08 7:40
mentorGiorgi Dalakishvili17-Mar-08 7:40 
QuestionWhat thing is done from IStream::Read to IWMReaderCallbackAdvanced::OnStreamSample? Pin
markliu-codeproject16-Mar-08 22:09
markliu-codeproject16-Mar-08 22:09 
GeneralMDI Child Form Pin
divyesh143216-Mar-08 21:33
divyesh143216-Mar-08 21:33 
GeneralRe: MDI Child Form Pin
parth.p17-Mar-08 0:13
parth.p17-Mar-08 0:13 
GeneralRe: MDI Child Form Pin
divyesh143217-Mar-08 0:16
divyesh143217-Mar-08 0:16 
GeneralSortedList Pin
Anneke16-Mar-08 11:35
Anneke16-Mar-08 11:35 
GeneralRe: SortedList Pin
Luc Pattyn16-Mar-08 14:34
sitebuilderLuc Pattyn16-Mar-08 14:34 
GeneralRe: SortedList Pin
Anneke18-Mar-08 9:13
Anneke18-Mar-08 9:13 
GeneralRe: SortedList Pin
Luc Pattyn18-Mar-08 13:00
sitebuilderLuc Pattyn18-Mar-08 13:00 
Generalunbound datagrid Pin
mr.me15-Mar-08 7:31
mr.me15-Mar-08 7:31 
GeneralRe: unbound datagrid Pin
Rocky#16-Mar-08 22:14
Rocky#16-Mar-08 22:14 
GeneralRe: unbound datagrid Pin
mr.me17-Mar-08 19:28
mr.me17-Mar-08 19:28 
GeneralRe: unbound datagrid Pin
Rocky#17-Mar-08 21:21
Rocky#17-Mar-08 21:21 

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.