Chapter 3 Working with Toolbox Controls 79
- Select the first PictureBox control named PictureBox1.
- Click the Image property in the Properties window, and then click the ellipsis button in
the second column.
The Select Resource dialog box appears. - Click the Local Resource radio button, and then click the Import button.
- In the Open dialog box, navigate to the C:\Vb10sbs\Chap03 folder.
- Select Calcultr .bmp, and then click Open.
- Click OK in the Select Resource dialog box.
The calculator appears in the PictureBox.
- Set the SizeMode property on the PictureBox to StretchImage.
- Set the following properties for the check box and PictureBox2 objects:
Object Property Setting
CheckBox1 Checked
Text
True
“Calculator”
CheckBox2 Text “Copy machine”
PictureBox2 SizeMode StretchImage
In these steps, you’ll use the check boxes to display and hide images of a calculator
and a copy machine. The Text property of the check box object determines the
contents of the check box label in the user interface. With the Checked property, you
can set a default value for the check box. Setting Checked to True places a check mark
in the box, and setting Checked to False (the default setting) removes the check mark.
I use the SizeMode properties in the picture boxes to size the images so that they
stretch to fit in the picture box.
Your form looks something like this: