Chapter 17 Working with Printers 423
Now you’ll run the program to see how a text box object prints.
Run the Print Text program
Tip The complete Print Text program is located in the C:\Vb10sbs\Chap17\Print Text folder.
- Click the Start Debugging button on the toolbar.
Your program runs in the IDE.
- Verify that your printer is on.
- Type some sample text in the text box. If you type multiple lines, be sure to include
a carriage return at the end of each line.
Wrapping isn’t supported in this demonstration program—very long lines will
potentially extend past the right margin. (Again, we’ll solve this problem soon .) Your
form looks something like this: - Click the Print Text button.
The program displays a printing dialog box and prints the contents of your text box.
- Modify the text box, and try additional printouts, if you like.
- When you’re finished, click the Close button on the form to stop the program.
Now you know how to print both text and graphics from a program.