How to add a picture box in Visual Basic

Written by stephen byron cooper Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to add a picture box in Visual Basic
Add a PictureBox to a form in Visual Studio. (Microsoft Corporation)

A PictureBox control in VB is a placeholder for an image. You apply the box by inserting a PictureBox object into your new form. The PictureBox is a standard object in the Toolbox. You add a PictureBox and then set its properties in order to reference the image that will appear in the placeholder. You can also alter the dimensions of the box in the Properties panel to make the box resize to the size of the image.

Skill level:

Other People Are Reading


  1. 1

    Open Visual Studio and create a new project. This will create a blank form, called Form1. The form will initially be smaller than you need, so resize it by dragging the lower right corner to the bottom right of the design panel.

  2. 2

    Click on the “Toolbox” tab on the left edge of the window. This opens the Toolbax, which contains a variety of object types that you can add to the form. Click on “PictureBox” and a new box will appear in your form. Drag the resize points around the edge of the box to resize it.

  3. 3

    Put a picture in the Picture box by clicking in the box and opening its Properties panel on the right side of the design panel. Look down the properties of the PictureBox to find “Image” alongside this property will be a value of “(none)” and then a button next to that value. Click on the button to open a dialogue window.

  4. 4

    Navigate through your computer’s directory structure to reach the folder where you keep the image you want to display in the PictureBox. Click on the image file and press the “Open” button. The image will display in your PictureBox.

  5. 5

    Look for the SizeMode property of the PictureBox. If the image is bigger than the box it will display the top left section of the picture that is covered by the PictureBox size. It will not scale the image to fit the box. Set the SizeMode property to AutoSize. This will cause the PictureBox to expend to the size of the image.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.