Sets or returns a value indicating whether the controls should be snapped to the grid points.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Property SnapGrid As Boolean |
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As Designer
Dim value As Boolean
instance.SnapGrid = value
value = instance.SnapGrid
|
| C# | |
|---|
public bool SnapGrid {get; set;} |
Return Value
Boolean value. If
True, the controls are snapped to the grid points. If
False, the controls can be sized and positioned freely.
Example
| C# | Copy Code |
|---|
private void designer1_Load(object
sender, System.EventArgs e)
{
this.designer1.DrawGrid = true;
this.designer1.GridX = 16;
this.designer1.GridY = 16;
this.designer1.SnapGrid = true;
} |
| Visual Basic | Copy Code |
|---|
Private Sub Designer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Designer1.Load
Me.Designer1.DrawGrid = True
Me.Designer1.GridX = 16
Me.Designer1.GridY = 16
Me.Designer1.SnapGrid = True
End Sub |
See Also