What are resource files and how do we generate resource files

Q

What are resource files and how do we generate resource files?

✍: Guest

A

Resource files are files which contain program resources. Many programmers think resource files for only storing strings. But you can also store bitmaps, icons, fonts, wav files in to resource files.
In order to generate resource file you need click on tools – generate local resource as shown in the figure below. Do not forget to keep page in designer view or else you will not see the option. Once you generate the resource file you will see the resx file generated in the solution explorer.

If you see the resource file it has basically key and the value for the key.

If you see the above figure the key is basically the object name. You can see the Label1 has some value stored in the resource file.

2007-11-01, 4403👍, 0💬