ShapeElement::GridSize Property
Visual Studio 2015
If non-zero, this shape and its children will snap to a grid of this size. Defaults to ParentShape.GridSize.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)
public: property double GridSize { virtual double get(); virtual void set(double value); }
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 DefaultGridSize
If you do not want alignment for any shapes in your diagram, override the SnapToGrid property in your diagram class to return false.
Show: