C_Sharp_Programmer
asked on
PageSetupDialog.AllowOrientation Not Working
Whenever I set the AllowOrientation property of a PageSetupDialog to 'true', it still doesn't allow the user to change the orientation of a document (meaning that the option for 'Landscape' isn't enabled). However, if I set PageSettings.Landscape (on the PageSetupDialog) to 'true', then when the PageSetupDialog box comes up, the document is set to Landscape, and you can toggle back and forth between portrait and landscape modes. However, I can't default my document to landscape as many users will want the document to be printed in portrait mode by default.
So am I missing something simple here? Thanks! Below is the code I'm using:
So am I missing something simple here? Thanks! Below is the code I'm using:
PageSetupDialog dlg = new PageSetupDialog();
dlg.Document = doc; //in this case, 'doc' is a PrintDocument
dlg.AllowOrientation = true; //this does not work!!!
//if the following line is un-commented, the orientation can be changed, but it defaults to
//landscape, which is unacceptable for my project.
//dlg.PageSettings.Landscape = true;
dlg.EnableMetric = true;
dlg.ShowDialog();
ASKER
Thanks for the suggestion, however, PageSettings does not have a property for Portrait mode, only Landscape...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dlg.PageSettings.Portrait = true