Книга: C# 2008 Programmer
Basics of Printing in .NET
Basics of Printing in .NET
In .NET, all the printing functionality is encapsulated within the PrintDocument
control/class, which can be found in the Toolbox (see Figure 16-13). The PrintDocument
control defines the various methods that allow you to send output to the printer.
Figure 16-13
To incorporate printing functionality into your Windows application, you can either drag and drop the PrintDocument
control onto your form or create an instance of the PrintDocument
class at runtime. This example uses the latter approach.
To start the printing process, you use the Print()
method of the PrintDocument
class. To customize the printing process using the PrintDocument
object, there are generally three events with which you need to be acquainted:
? BeginPrint
— Occurs when the Print()
method is called and before the first page of the document prints. Typically, you use this event to initialize fonts, file streams, and other resources used during the printing process.
? PrintPage
— Occurs when the output to print for the current page is needed. This is the main event to code the logic required for sending the outputs to the printer.
? EndPrint
— Occurs when the last page of the document has printed. Typically, you use this event to release fonts, file streams, and other resources used during the printing process.
- Managing volumes
- Улучшенный протокол локальных соединений (XNET)
- Chapter 16. Commercial products based on Linux, iptables and netfilter
- Basics of the iptables command
- NETMAP target
- Internet Service Providers who use assigned IP addresses
- Специфика .NET Compact Framework: ADO.NET
- Формы Web ASP.NET
- При запуске Internet Explorer загружается какая-то непонятная страница. Как ее отключить?
- В ходе экспериментов отключил Internet Explorer, теперь не могу его включить
- Почему во время просмотра сайтов в Internet Explorer при прокрутке колесиком мыши страницу как бы листает волнами, а не ...
- 5.1.1. netconf