ShapeElement.GridSize Property

If non-zero, this shape and its children will snap to a grid of this size. Defaults to ParentShape.GridSize.

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

Syntax

'Declaration
Public Overridable Property GridSize As Double
'Usage
Dim instance As ShapeElement 
Dim value As Double 

value = instance.GridSize

instance.GridSize = value
public virtual double GridSize { get; set; }
public:
virtual property double GridSize {
    double get ();
    void set (double value);
}
public function get GridSize () : double 
public function set GridSize (value : double)

Property Value

Type: System.Double
The size of the grid for the shape.

Remarks

If the value is non-zero, after the user moves the shape, the shape’s position will be adjusted so that its X and Y values are multiples of the GridSize relative to the parent shape or diagram. The default value is 0.125.

Override this property to change the grid size for a particular type of shape and its children.

To change the grid size for a diagram and all of its contents, override DefaultGrideSize

If you do not want alignment for any shapes in your diagram, override the SnapToGrid property in your diagram class to return false.

.NET Framework Security

See Also

Reference

ShapeElement Class

ShapeElement Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace