Uhc Uhc
Uhc Uhc

Reputation: 21

How do I set the paper size in PrintPreviewDialog?

For example =>

PrintPreviewDialog1.WindowState = FormWindowState.Normal
PrintPreviewDialog1.StartPosition = FormStartPosition.CenterScreen
PrintPreviewDialog1.ClientSize = New Size(600, 600)

But i want the paper size?

Upvotes: 1

Views: 4520

Answers (1)

Ken White
Ken White

Reputation: 125640

You set the paper size through the PrintDocument that you'll be previewing with the PrintPreviewDialog:

printDocument1.DefaultPageSettings.PaperSize =  _
   printDocument1.PrinterSettings.PaperSizes[Index]

For more information, see the PaperSize docs at MSDN.

Upvotes: 1

Related Questions