469,291 Members | 1,626 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,291 developers. It's quick & easy.

Size and position of a PrintPreviewDialog

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!
Jul 21 '05 #1
2 13275
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.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence diagrams
Michael A. Covington wrote:
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!

Jul 21 '05 #2
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!

"Rodger Constandse" <ro*************@effexis.com> wrote in message
news:V7****************@twister.socal.rr.com...
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.

--
Rodger Constandse

<http://www.SequenceDiagramEditor.com>
Sequence Diagram Editor - A quick and easy way to draw and edit sequence
diagrams
Michael A. Covington wrote:
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!


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by VS Noob | last post: by
2 posts views Thread by Michael A. Covington | last post: by
reply views Thread by Joe Thompson | last post: by
1 post views Thread by Jack E. Hardie | last post: by
4 posts views Thread by BrianKE | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.