430 Part III Designing the User Interface
- Verify that your printer is on, and then click the Print button.
Visual Basic displays the Print dialog box, customized with the name and settings for
your printer, as shown in the following screen shot:
Many of the options in the Print dialog box are active, and you can experiment with
them as you would a regular Windows application.
- Click Print to print the document.
Your program submits the four-page print job to the Windows print queue. After a
moment (and if your printer is ready), the printer begins printing the document. As in
previous exercises, a dialog box automatically opens to show you the printing status
and gives you an indication of how many pages your printed document will be.
- Click the Close button on the form to stop the program.
You’ve just created a set of very versatile printing routines that can be added to any Visual
Basic application that needs to print multiple pages of text!
One Step Further: Adding Print Preview and Page Setup Dialog Boxes
The Print File application is ready to handle several printing tasks, but its interface isn’t
as visually compelling as that of a commercial Windows application. You can make your
program more flexible and interesting by adding a few extra dialog box options to
supplement the Print dialog box that you experimented with in the previous exercise.