Back to Devexpress

DiagramControl.FitToDrawing() Method

windowsforms-devexpress-dot-xtradiagram-dot-diagramcontrol-21a8c7ff.md

latest2.7 KB
Original Source

DiagramControl.FitToDrawing() Method

Changes the page size to fit the diagram contents.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
public void FitToDrawing()
vb
Public Sub FitToDrawing

Remarks

The FitToDrawing method shrinks or extends the current page bounds so that they are sufficiently large to fit the diagram contents. The DiagramOptionsView.FitToDrawingMargin property specifies the margin between the diagram content and the page bounds.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FitToDrawing() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-use-custom-graph-layout-algorithms-to-arrange-shapes-in-diagramcontrol-t394210/CS/XtraDiagram.CustomLayoutAlgorithms/CustomLayoutForm.cs#L61

csharp
};
    diagramControl.FitToDrawing();
} catch(Exception e) {

how-to-use-custom-graph-layout-algorithms-to-arrange-shapes-in-diagramcontrol-t394210/VB/XtraDiagram.CustomLayoutAlgorithms/CustomLayoutForm.vb#L62

vb
Next connector
    diagramControl.FitToDrawing()
Catch e As Exception

See Also

FitToDrawingMargin

DiagramControl Class

DiagramControl Members

DevExpress.XtraDiagram Namespace