J
Jack
I was learning Windows programming in C# using Charles Petzold book,
but this book was written for the older version of .NET. The example
of using icon from embedded resource fails to work when executed step
by step following the book directions and I can't find what is wrong.
The executable throws an exception claiming that the resource cannot
be found.
The steps I'm taking are:
1) I created simple icon 32 x 32 16 colors file, named: iconfile.ico.
2) I added the icon file to the project using Add Existing Item ...
3) I changed build action to embedded resource for the added icon.
4) In the project options I changed DefaultNamespace to: Resource
5) In the Form1 constructor at the end I added the following line:
Icon = Icon(GetType(),"Resource.iconfile.ico");
6) I built the project (OK) and run it but it fails on the added
line of code with the mentioned exception.
What am I missing ?
Jack
but this book was written for the older version of .NET. The example
of using icon from embedded resource fails to work when executed step
by step following the book directions and I can't find what is wrong.
The executable throws an exception claiming that the resource cannot
be found.
The steps I'm taking are:
1) I created simple icon 32 x 32 16 colors file, named: iconfile.ico.
2) I added the icon file to the project using Add Existing Item ...
3) I changed build action to embedded resource for the added icon.
4) In the project options I changed DefaultNamespace to: Resource
5) In the Form1 constructor at the end I added the following line:
Icon = Icon(GetType(),"Resource.iconfile.ico");
6) I built the project (OK) and run it but it fails on the added
line of code with the mentioned exception.
What am I missing ?
Jack