IC#/C sharp Accessing Resources at Run-Time

To access a resource at run-time, simply reference it as you would any
other class member. The following example shows how to retrieve a
bitmap resource that you named Image01. Note that the Resources class
is in a namespace called <projectName>.Properties, so you must either
user the fully qualified name for each resource or else add the
appropriate using directive in the source file from which you are
accessing the Resources class.

System.Drawing.Bitmap bitmap1 = myProject.Properties.Resources.Image01;

No comments:

Post a Comment