Resource Basics
Imagine setting the background image of a form in your application by loading a bitmap from a file:
Public Sub New() ... ' Load a file from the file system Me.BackgroundImage = _ New Bitmap("C:\WINDOWS\Web\Wallpaper\Azul.jpg") End Sub
The problem with this code is that not all installations of Windows will have Azul.jpg, and even those that do have it may not have it in the same place. Even if you shipped this picture with your application, a space-conscious user may decide to remove it, causing your application to fault. The only safe way to make sure that the picture, or any file, stays with code is to embed it and load it as a resource, a named piece of data embedded in the assembly itself.
Manifest Resources
Resources are ...
Get Windows Forms Programming in Visual Basic .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.