How to Remove the Gray Area around a Diagram?

You can remove the unnecessary gray area added around a diagram by setting the ScrollVirtualBounds property as Empty. The following code example illustrates this.

//Remove the unwanted gray area around a diagram.

diagram1.View.ScrollVirtualBounds = RectangleF.Empty;
'Remove the unwanted gray area around a diagram.

diagram1.View.ScrollVirtualBounds = RectangleF.Empty;