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);