88 Part I Getting Started with Microsoft Visual Basic 2010
Run the List Box program
Tip The complete List Box program is located in the C:\Vb10sbs\Chap03\List Box folder.
- Click the Start Debugging button on the Standard toolbar.
Visual Basic runs the program in the IDE. The three items appear in the list box, but
because no item is currently selected, nothing appears yet in the picture box object.
- Click the first item in the list box (Extra Hard Disk).
Visual Basic displays the hard disk image, as shown here:
- Click the second item in the list box (Printer).
The printer image appears.
- Click the third item in the list box (Satellite Dish).
The satellite dish appears. Perfect—all of the list box code seems to be working
correctly, although you should always continue to test these things (that is, check the
various user input options) to make sure that nothing unexpected happens. As you’ll
learn later in the book, you always want to test your programs thoroughly, especially
the UI elements that users have access to.
- Click the Close button on the form to end the program.
You’re finished working with list boxes for now. If you like, you can continue to
experiment with the ComboBox and CheckedListBox controls on your own—they
operate similar to the tools you have been using in the last few exercises.