New to Telerik UI for WinFormsStart a free 30-day trial

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class SnapToGrid

Inheritance: objectSnapToGrid

Constructors

The default constructor sets the following default values: FieldWidth = 1.0f; SnapRelative = 0.2f; SnapDelta = 0.2f; SnapType = SnapTypes.Relative;

C#
public SnapToGrid()
C#
public SnapToGrid(ref SnapToGrid e)
Parameters:eSnapToGrid

Properties

Gets the precached snap distance. Doesn't need to be equal to any of the SnapFixed or SnapRelative properties.

C#
public float CachedSnap { get; }

Width of a single box in the snap grid. It's value cannot be less than or equal to zero.

C#
public float FieldWidth { get; set; }

Sets/Gets the snap distance for fixed type snapping. Does not activate fixed type snapping. SnapType

C#
public float SnapFixed { get; set; }
C#
public PointF SnappedPoint { get; }

Sets/Gets the relative snap distance. Does not activate relative type snapping. SnapType

C#
public float SnapRelative { get; set; }

Set the snap type to be one of the following: SnapTypes.Relative - snap distance is relative to the FieldWidth SnapFixed SnapTypes.Fixed - snap distance is fixed

C#
public SnapToGrid.SnapTypes SnapType { get; set; }

Methods

C#
public int SnapPtToGrid(PointF pos)
Parameters:posPointFReturns:

int