How to Change the Page Orientation in WinForms Diagram?
How to change page orientation
The WinForms Diagram provide an option to change the orientation of the diagram page by using the DocumentSize property. By using this property, swap the Height and Width values to change the orientation to Landscape or Portrait.
Refer to the following code example to swap the values.
C#
/ To change the diagram size to 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 to 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 feature tour page to learn 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!