Tuesday, December 11, 2007

How to work the Picture Boxes

How to work the Picture Boxes

To work the Picture Boxes

Below is the Syntax of Picture Boxes:

PictureBoxName.Picture=LoadPicture([filename])

Step 1:

Add the Picture Box and Command Button to the Form.

Step 2:

Write the VB programming codes for the button. In this example, an image file will be loaded from D drive to the Picture Box:

Private Sub Command1_Click()

Set Picture1.Picture = LoadPicture("D:\New Folder\babe1.bmp")

End Sub

Step 3:

The image file is loaded from D drive to the Picture Box after clicking on the Command button:


No comments: