473,412 Members | 2,262 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,412 software developers and data experts.

PageSetupDialog result not change

1
Hello,

I am using PageSetupDialog in my application to change the pagesettings of
the document,I changed PaperSize To "A4" in PageSetupDialog ,But it's result PaperSize no change ??I want Set PaperSize in PageSetupDialog And result OK;
source code:
private void button2_Click(object sender, EventArgs e)
{
pd = new PrintDocument();
PageSetupDialog mPS = new PageSetupDialog();
foreach (PaperSize ps in pd.PrinterSettings.PaperSizes)
{
if (ps.PaperName == "Letter")
{
pd.PrinterSettings.DefaultPageSettings.PaperSize = ps;
pd.DefaultPageSettings.PaperSize = ps;
}
}
mPS.Document = pd;
if (mPS.ShowDialog() == DialogResult.OK) //i change PaperSize to "A4"
{
mPS.PageSettings;
mPS.PrinterSettings;
mPS.Document.DefaultPageSettings.PrinterSettings;
mPS.Document.DefaultPageSettings.PaperSize;
//all result PaperSize is "Letter",but in PageSetupDialog run "print" button And Set PaperSize to "A4" in PrintDialog,resule OK;
}
}
Sep 18 '07 #1
0 1118

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andy Sze | last post by:
Visual Studio.net 2003 no yet fix the PageSetupDialog bug. http://support.microsoft.com/?id=814355 Here is my new solution: Private Sub btnPageSetup_Click(ByVal sender As System.Object, _...
6
by: Just Me | last post by:
Dim PageSetupDialog As New PageSetupDialog With PageSetupDialog ..Document = mPD ....snip
0
by: Just Me | last post by:
I do the code at the bottom of this, and later use: zz = mPD.DefaultPageSettings.PaperSize.Height and it works most of the time. It's a long story but if I use the printer's "Custom" size I do...
2
by: Amjad | last post by:
I use the PageSetupDialog box to allow the user to change the page margins before printing. The problem is when I open the dialog box and type in margin values in millimeters (as it says in the...
1
by: Blaine | last post by:
When I show my Windows Form as a dialog box (ShowDialog(Me)) and click on a button that calls the ShowDialog of either the PageSetupDialog or PrintDialog conrtol, my Windows Form closes After I...
1
by: Dennis | last post by:
I am trying to use the PageSetUpDialog and set some defaults before it shows; PageSetUpDialog1.Document.DefaultPageSettings.Landscape =True...
1
by: Ratan | last post by:
Hello, I am using PageSetupDialog in my application to change the pagesettings of the document but i dont want to show all the page size to the user, I want to show only A3 and A4 size for...
1
by: Ed Sutton | last post by:
My C# app. apparently has problems with PageSettings not being initialized properly after calling PageSetupDialog. If a user selects a non-default printer from PageSetupDialog, the PageSize is...
0
by: ppeterkin | last post by:
I customized a PrintPreviewDialog by adding a button to it's toolstrip that opens up a PageSetupDialog. The problem is changes made to the page setup are not passed to the PrintPreviewDialog until...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.