Articles in this section
Category / Section

How can I display the view to the center of diagram control?

1 min read

Display view to the center of diagram control?

You can use the following code to display the view to the center of the diagram control.

float locationX = (diagram1.Width - diagram1.View.Width) / 2;

float locationY = (diagram1.Height - diagram1.View.Height) / 2;

this.diagram1.View.Origin = new PointF(-locationX, -locationY);

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied