Windows Application - SPLessons

Win App Picture Box Control

Home > Lesson > Chapter 13
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Win App Picture Box Control

Windows Application Picture Box Control

shape Description

Picture Box Control is a control which is used to display different types of images in the windows application. It supports many formats of images. By using PictureBox control, one can also resize their image.

shape Properties

The following are the properties of the picture box control.
  • Image Image property is used to give a path of the image to the picture box which we want to display.
  • Image Location Image Location property is used to download an image from the website. We have to give the website URL to download the image and to display the image.
  • Size Mode Size Mode property is used to set an image position. Size Mode property contains the values as shown in the below table.
    Property Value Value Usage
    Normal Place the exact image into picture box it it the default value.
    StretchImage The Image will be stretched.
    AutoSize Set the image into the picture box.
    CenterImage The Image will be displayed in the center of the picture box.
    Zoom The image will be zoomed.

How to use the picture box control?

shape Steps

The below steps explain the use of picture box control.
  • Drag and drop the picture box control onto the form and give the appropriate name the picture box. Then the form will be displayed like below figure.
  • To Give the image path follow the below steps.
    • Go to properties window and see the Image property and click on the icon as shown in the below figure.
    • Now, Select Resource window will appear as shown in the below figure.
    • Click on the Import button.
    • Now, Open dialogue box will appear as shown in the below figure.
    • Open the image, which to be display.
    • Click on the OK button. Then the image will be displayed in the Form as shown in the below figure.
  • Press F5 to run the application.
  • Then the image will be displayed as follows.
One can also display image in Autosize,  Zoom, Normal and CenterImage. The above figure is in the StretchImage mode.