Diagram::GridSize Property

 

Gets or sets the default grid size for the shapes on the diagram.

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

public:
property double GridSize {
	virtual double get() override;
	virtual void set(double value) override;
}

Property Value

Type: System::Double

The size of the grid for the diagram.

When a shape is moved by the user, it snaps to a grid – that is, its position is adjusted so that the X and Y coordinates are multiples of the grid size. For each shape, the relevant grid size is specified by its own GridSize property, and the default value is the GridSize of the parent. The grid size of a diagram determines the default GridSize for its children.

Set this value to change the grid size for the diagram and the default for its child shapes.

If you want to change the default grid size for all instances of a diagram type, override DefaultGridSize.

To switch off grid adjustment, set the GridSize to 0.0.

Return to top
Show: