How to Access an Image in the Resources Using VB.Net

In this tutorial I will show you how to access an image in the resources using vb.net. This method will help you to embed an image from the resources to a picture box. It is very simple and yet very useful. I Hope this tutorial will solve some of your problems. So let’s get started:

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application. ps1.1.1

Step 2

Go to toolbar and drag a Label, two Button and a PictureBox. Do the form just like shown below. ps1.1.2

Step 3

Add two images into the resources. Click Here.

Step 4

Click a Login Button to fire the click event hander and do the following codes for accessing an image in the resources and embed it into the PictureBox.
  1. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
  2. PictureBox1.Image = My.Resources.login

Step 5

Go to Design views, click a Logout Button to fire the click event hander and do the following codes for accessing an image in the resources and embed it into the PictureBox.
  1. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
  2. PictureBox1.Image = My.Resources.logout
For more question about this article. You can contact me @ Email – [email protected] Mobile No. – 09305235027 – TNT FB Account – https://www.facebook.com/onnaj.soicalap

Add new comment