358 Part III Designing the User Interface
- Click the Help button.
Visual Basic opens the second form in the project, HelpInfo .vb, and displays the
Readme .txt file in the text box object. The form looks like this:
- Use the vertical scroll bar to view the entire Readme file.
- Try to click the Spin button on the LuckySeven .vb form.
Notice that you cannot activate the LuckySeven .vb form while the HelpInfo .vb form is
active. Because the HelpInfo .vb form is a dialog box (a modal form), you must address it
before you can continue with the program.
- Click OK to close the HelpInfo .vb form.
The form closes, and the LuckySeven .vb form becomes active again.
- Click the Spin button a few more times, and then click the Help button again.
The HelpInfo .vb form opens again and is fully functional.
- Click OK, and then click End on the LuckySeven .vb form.
The program stops, and the development environment returns.
Using the DialogResult Property in the Calling Form
Although I didn’t demonstrate it in the sample program, you can use the DialogResult
property that you assigned to the dialog box to great effect in a Visual Basic program. As
I mentioned earlier, a more sophisticated dialog box might provide additional buttons to the