Size and position of a PrintPreviewDialog

  • Thread starter Thread starter Michael A. Covington
  • Start date Start date
M

Michael A. Covington

By default, my PrintPreviewDialog is coming out too small. What is the best
way to control its size and position? Ideally, I'd just like to maximize
it. Thanks!
 
Hi Michael,

You can maximize the PrintPreviewDialog by first casting it as a Form, and then
setting the WindowState property.

PrintPreviewDialog dialog = new PrintPreviewDialog();

dialog.Document = printDoc;

// show print preview dialog in maximized state
((Form) dialog).WindowState = FormWindowState.Maximized;
dialog.ShowDialog();

Hope this helps.
 
Yes, that worked, and I didn't even have to cast it, but for some reason the
form then came up unselected, so I did a dialog.Select() (or something of
the sort) and it worked. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top