471,595 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

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 13742
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
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.