Rather than having to create a new "About" form for every program that I write; I have written a class which will create a new form at runtime with all the objects placed. This has been designed so that the class can be added to any project that I am doing and executed as a new instance - voila, one "About" box.
The problem I am currently having is the ability to display a logo on said form. Normally, images are displayed using:
The resource will be added to every project I do in the foreseeable future so it will always be named the same. The issue I am having is being to maintain my plug-into-any-project class, since I am unsure how to derive the current project's resources.
I have a method of getting the application (namespace) name using:
However, this does not seem to be helping me at all.
So basically, I want to be able to stick my class into any project I am working on and have it access the current project's resources and set an image accordingly. This means, I don't want project names hard-coded.
Is this even possible? If so, could someone please shed some light on how it can be done?
Thanks.
The problem I am currently having is the ability to display a logo on said form. Normally, images are displayed using:
Code:
pictureBox1.Image = global::<projectname>.Properties.Resources.<resourcename>
I have a method of getting the application (namespace) name using:
Code:
System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
So basically, I want to be able to stick my class into any project I am working on and have it access the current project's resources and set an image accordingly. This means, I don't want project names hard-coded.
Is this even possible? If so, could someone please shed some light on how it can be done?
Thanks.
Comment