Chapter 3
Working with Toolbox Controls
After completing this chapter, you will be able to:
Use TextBox and Button controls to create a Hello World program.
Use the DateTimePicker control to display your birth date.
Use CheckBox, RadioButton, ListBox, and ComboBox controls to process user input.
Use the LinkLabel control and the Process.Start method to display a Web page by using your system's default browser.
As you learned in earlier chapters, Microsoft Visual Studio 2005 controls are the graphical tools you use to build the user interface of a Microsoft Visual Basic program. Controls are located in the development environment's Toolbox, and you use them to create objects on a form with a simple series of mouse clicks and dragging motions.
Upgrade Notes: Migrating Visual Basic 6 Code to Visual Basic 2005
If you're experienced with Microsoft Visual Basic 6, you'll notice some new features in Microsoft Visual Basic 2005, including the following:
A new control named DateTimePicker helps you prompt the user for date and time information. The new LinkLabel control is designed to display and manage Web links on a form.
The OptionButton control has been replaced with a new RadioButton control.
The Frame control has been replaced with a new GroupBox control.
The ListIndex property of the ListBox control has been replaced with a property called SelectedIndex. The same change was made to the ComboBox control.
There is no longer an Image control. You use the PictureBox control instead.
Images are added to picture box objects by using the System.Drawing.Image.FromFile method (not the LoadPicture function).
Microsoft Windows applications are now started within a program by using the System.Diagnostics.Process.Start method.
Windows forms controls are specifically designed for building Windows applications, and you'll find them organized on the All Windows Forms tab of the Toolbox, although many of the controls are also accessible in tabs such as Common Controls, Containers, and Printing. (You used a few of these controls in the previous chapter.) You'll learn about other controls, including the tools you use to build database applications and Web pages, later in the book.
In this chapter, you'll learn how to display information in a text box, work with date and time information on your system, process user input, and display a Web page within a Visual Basic program. The exercises in this chapter will help you design your own Visual Basic applications and will teach you more about objects, properties, and program code.