473,372 Members | 1,572 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,372 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 14231
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.