What must you do to allow a page to be displayed, when running the application?

The following code was added to add a PrintPreviewControl instance to a Panel control named testpanel.

PrintPreviewControl printPreview = new PrintPreviewControl[]; printPreview.Columns = 2;
printPreview.Rows = 2;
printPreview.Dock = DockStyle.Fill;
testpanel.Controls.Add[printPreview];

When you run the application that has this code, you received the following message on the Panel control. Document does not contain any pages. What must you do to allow a page to be displayed, when running the application?

The following code was added to add a PrintPreviewControl instance to a Panel control named testpanel.

PrintPreviewControl printPreview = new PrintPreviewControl[]; printPreview.Columns = 2;
printPreview.Rows = 2;
printPreview.Dock = DockStyle.Fill;
testpanel.Controls.Add[printPreview];

When you run the application that has this code, you received the following message on the Panel control. Document does not contain any pages. What must you do to allow a page to be displayed, when running the application?

A.
You should set the StartPage property of printPreview to 1

B.
You should set the Visible property of printPreview to true

C.
You should call the Show method of printPreview

D.
You should set the Document property of printPreview to an instance of PrintDocument

Explanation:
To display a preview of a document when the Document property is set, you should use the PrintPreviewControl.

Incorrect Answers:
A: The StartPage property has no effect if the Documentproperty is not set to a PrintDocument instance.
B: This shows that the controls should be visible.
C: The property has no effect if the Documentproperty is not set.
C: Set the UseAntiAlias property to True to make the text appear smoother.
D: Set the Zoom property to establish the relative zoom level when the document preview appears.



Leave a Reply 0

Your email address will not be published. Required fields are marked *