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;
}
}