How to Change the Page Orientation in WinForms Diagram?
How to change page orientation
The WinForms Diagram provide option to change orientation of the diagram page by using DocumentSize property. By using this property, swap the Height and Width values to change the orientation as Landscape or Portrait.
Refer to the following code example to swap the values.
C#
// To change the diagram size as Landscape private void ChangePageOrientation(Model model) { if (model.DocumentSize.Width < model.DocumentSize.Height) { float temp = model.DocumentSize.Width; model.DocumentSize.Width = model.DocumentSize.Height; model.DocumentSize.Height = temp; } } // To change the diagram size as Portrait private void ChangePageOrientation(Model model) { if (model.DocumentSize.Width > model.DocumentSize.Height) { float temp = model.DocumentSize.Height; model.DocumentSize.Height = model.DocumentSize.Width; model.DocumentSize.Width = temp; } }
Conclusion
I hope you enjoyed learning about how to change the page orientation in WinForms Diagram.
You can refer to our WinForms Diagram featuretour page to know about its other groundbreaking feature representations and documentation, to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!