1

如何将打印预览和打印代码设置为横向?

 this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
            this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
            this.printPreviewDialog1.ClientSize = new System.Drawing.Size(700, 600);
            this.printPreviewDialog1.Document = this.printDocument1;
            this.printPreviewDialog1.Enabled = true;
            this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
            this.printPreviewDialog1.Name = "printPreviewDialog1";
            this.printPreviewDialog1.Visible = false;

            // 
            // printDocument1
            // 
            this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage_1);
4

3 回答 3

4

这成功了

this.printDocument1.DefaultPageSettings.Landscape = true;
于 2013-04-11T16:48:13.250 回答
0

这个不行吗

var doc = new PrintDocument();
doc.DefaultPageSettings.Landscape = true;

做这个把戏?

它也可能会处理打印预览问题。

于 2013-04-10T18:09:14.627 回答
0

这对我有用

private void button_Click(object sender, EventArgs e)
{
    printPreviewDialog1.Document = printDocument1;
    printDocument1.DefaultPageSettings.Landscape = true;
    printPreviewDialog1.ShowDialog();
}
于 2021-10-22T07:48:58.687 回答