JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the PrintDialog Class

So how does one actually print a document? You start with a Print dialog, which displays the actual Print button, and is supported by the PrintDialog class; here is the hierarchy of that class:

Object
   MarshalByRefObject
      Component
         CommonDialog
            PrintDialog

You can find the notable public properties of PrintDialog objects in Table 9.27, the notable public methods in Table 9.28, and the notable events in Table 9.29.

Table 9.27: Noteworthy public properties of PrintDialog objects.

Property

Means

AllowPrintToFile

Gets/sets whether the Print to file checkbox is enabled.

AllowSelection

Gets/sets whether the Selection radio button is enabled.

AllowSomePages

Gets/sets whether the From... To... Page radio button is enabled.

Document

Gets/sets the PrintDocument used to obtain PrinterSettings.

PrinterSettings

Gets/sets the PrinterSettings dialog box to modify.

PrintToFile

Gets/sets whether the Print to file checkbox is checked.

ShowHelp

Gets/sets whether the Help button is displayed.

ShowNetwork

Gets/sets whether the Network button is displayed.

Table 9.28: Noteworthy public methods of PrintDialog objects.

Method

Means

Reset

Resets all dialog options.

ShowDialog

Shows the dialog.

Table 9.29: Noteworthy public events of PrintDialog objects.

Event

Means

HelpRequest

Occurs when the user clicks the Help button.

So what happens when the user actually clicks the OK button in a Print dialog? See the next topic.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor