WIZARDS

One common type of dialog box is called a wizard. A wizard is a form that guides the user through a series of steps to do something. For example, building a database connection is complicated, so Visual Basic provides a data connection configuration wizard that helps the user enter the correct information for different kinds of databases. When it finishes, the wizard adds a connection object to the current form.

Figure 9-3 shows one kind of wizard. The user enters data on each tab and then moves on to the next one. This wizard asks the user to enter an employee’s name, identification (Social Security number and Employee ID), address and phone number, office location and extension, and privileges. Many tabbed wizards also include Next and Previous buttons to help you move from one tab to another.

FIGURE 9-3: A wizard guides the user through the steps of some complicated task.

image

When the user has filled in all the fields, the wizard enables the OK button. When the user clicks the OK or Cancel button, control returns to the main program, which handles the result just as it handles any other dialog box.

Figure 9-4 shows a different style of wizard. Instead of tabs, it uses buttons to let the user move through pages of fields. The wizard enables a button only when the user has filled in the necessary information on the previous page. In Figure 9-4, the Office button is disabled ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.