Share via


Diagram.SnapToGrid Property

Gets the diagram and verifies whether its shapes can be snapped to the grid or sets the ability to snap shapes to the grid.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property SnapToGrid As Boolean
'Usage
Dim instance As Diagram 
Dim value As Boolean 

value = instance.SnapToGrid

instance.SnapToGrid = value
[BrowsableAttribute(false)]
public bool SnapToGrid { get; set; }
[BrowsableAttribute(false)]
public:
property bool SnapToGrid {
    bool get ();
    void set (bool value);
}
public function get SnapToGrid () : boolean 
public function set SnapToGrid (value : boolean)

Property Value

Type: System.Boolean
true if shapes in the diagram can be snapped to the grid; otherwise, false.

Remarks

When snap-to-grid is turned on, shapes are automatically aligned as you position or move them on the page. They are snapped to an invisible grid.

.NET Framework Security

See Also

Reference

Diagram Class

Diagram Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace