SUMMARY

The PrintDocument object sits at the heart of the Visual Basic printing process. A program makes a PrintDocument object and then responds to its BeginPrint, QueryPageSettings, PrintPage, and EndPrint events to generate a printout.

The PrintDocument object’s Print method immediately generates a printout. You can also attach the PrintDocument to a PrintDialog, PrintPreviewDialog, or PrintPreviewControl and use those objects to display previews and generate printouts.

This chapter described printing in general. Using the Graphics object provided by the PrintDocument object’s PrintPage event, you can print lines, curves, text, images, and anything else you can draw to the screen.

Appendix I, “Visual Basic Power Packs,” describes some additional tools that you can download for free. The Printer Compatibility Library and the PrintForm component give you new options for printing. See Appendix I for more information.

Most of the programs described in this book so far are relatively self-contained. They take input from the user, perform some calculations, and display the results. Only a few chapters have interacted much with the outside system. The two exceptions are Chapter 22, which explained how to use drag and drop and the clipboard to interact with other programs, and this chapter, which explained how to interact with printers.

The programs described earlier in this book interact only with the user. Printing is one way a program can interact with some other part of the system. The next chapter, “Configuration and Resources,” describes some other ways that a Visual Basic program can interact with the system by storing configuration and resource values for use at run time. Some of the most useful of these methods include environment variables, the Registry, configuration files, and resource files.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.135.175