---
title: "PictureBox Control in VB.Net"  
description: "PictureBox control is used to display image. The images displayed can be any format like Bitmap, JPEG, and GIF, PNG or any other image format files. T"  
author: "Pushpendra Singh"  
published: 2010-12-13  
updated: 2020-02-09  
canonical: https://www.mindstick.com/articles/312/picturebox-control-in-vb-dot-net  
category: "vb.net"  
tags: ["vb.net"]  
reading_time: 1 minute  

---

# PictureBox Control in VB.Net

PictureBox [control](https://yourviews.mindstick.com/view/83439/bipartisan-gun-control-bill-passed-in-us-after-decades) is used to [display image](https://www.mindstick.com/forum/33970/how-to-display-image-without-streach-in-uiscrollview). The [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support) displayed can be any [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) like [Bitmap](https://www.mindstick.com/forum/23141/saving-bitmap-as-png-on-wp7), JPEG, and GIF, PNG or any other image format files. The PictureBox control is based on the Control class.\

## How to use PictureBox control

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) the PictureBox control from toolbox on the [Window Form](https://www.mindstick.com/forum/527/how-to-pass-datagridview-s-cells-value-to-another-window-form).

![PictureBox Control in VB.Net](https://www.mindstick.com/mindstickarticle/510a9eaa-1901-4c19-b2e1-e21f0176a5e3/images/fe7d3c3b-7511-462e-9d3c-26c470aab7c8.png)

## Code:

```
Public Class Form13   Private Sub Form13_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load  'show image in PictureBox PictureBox1.Image = Image.FromFile("C:\Pictures\Sample Pictures\image1.png")     End Sub  End Class
```

FromFile method is used to find the image.

**Run the project**

Image will show in PictureBox when application run.

![PictureBox Control in VB.Net](https://www.mindstick.com/mindstickarticle/510a9eaa-1901-4c19-b2e1-e21f0176a5e3/images/b21a4fe9-13bc-4c2e-a149-187fa812c7ea.png)

**Size Mode [property](https://www.mindstick.com/articles/198559/an-ownership-of-property-in-hua-hin) of PictureBox:** Set the Image size mode by [default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) it set to Normal.

```
Private Sub Form13_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         'set sizemode to CenterImage         PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage End Sub
```

Centre image will show in PictureBox.

![PictureBox Control in VB.Net](https://www.mindstick.com/mindstickarticle/510a9eaa-1901-4c19-b2e1-e21f0176a5e3/images/0b831925-4c02-47fa-91b6-5fdd95e5f391.png)

---

Original Source: https://www.mindstick.com/articles/312/picturebox-control-in-vb-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
