Click here to Skip to main content
15,945,119 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I set the print Preview and print code to landscape orientation ?

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);
Updated 10-Apr-13 8:01am
ZurdoDev 10-Apr-13 13:23pm    
Tomaž Leitinger 10-Apr-13 13:43pm    
In the Designer.cs
ZurdoDev 10-Apr-13 15:00pm    
Isn't it just a property? Something like printDocument1.DefaultPageSettings.Landscape?
Tomaž Leitinger 10-Apr-13 15:15pm    
I don't know how it works, I just know that it does :D
Sergey Alexandrovich Kryukov 16-Apr-13 0:38am    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership. And the fact you even self-accepted some formally is just outrageous, a sure way for a ban. I hope you won't do it after this warning.

Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.

1 solution

Isn't it just a property? Something like printDocument1.DefaultPageSettings.Landscape?
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900