473,394 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 14246
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ramsey Schaffnit | last post by:
Context: I have to print personal information on a preprinted form I've never seen using a printer I've never seen. I want to use a control to overlay the PrintPreview to indicate where I've...
2
by: Randy | last post by:
Hello all, I'm trying to print using PrintPreviewDialog. What's happening is that the PrintPreviewDialog shows the correct information to be printed, but when I click the print icon, it prints a...
2
by: VS Noob | last post by:
Hello. I'm developing Windows.Forms based applications, and each will need per-user persistent data consisting of user preferences, last form size/position, and the like. Is there a standard or...
2
by: Michael A. Covington | last post by:
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!
0
by: Joe Thompson | last post by:
Hi, I am new to .net programming but am used to Borland C++ Builder (like Delphi). There are third party components available that you drop on a form and it will save the forms size, position,...
4
by: gsb58 | last post by:
Hi! I have a Textbox control on a form and a PrintPreviewDialog. How on earth can I associate the Textbox control with the PrintPreviewDialog, so that the text from the Textbox control will...
1
by: Jack E. Hardie | last post by:
When I call the PrintPreviewDialog, the resulting default window and zoom size are too small to read. I have figured out how to resize the window, but can someone help me with the call to preset...
4
by: BrianKE | last post by:
I am attempting to create an app that will run "on top" of another app. My app will create a transparent window over the other app for the purpose of displaying information. I am able to create...
0
by: tim8w | last post by:
I have the following PrintPreviewDialog code: Code: Private Sub tsbPrintPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbPrintPreview.Click Dim...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.