I want when use moves the certain type of nodes i want to snap the center of node to center of grid rectangle. Some type of nodes user need to move freely. Can you suggest which event should i use after the node moves i want to adjust to center of grid rectangle.
Grid snapping moves the Location of objects (when dragging) to a point in a grid cell. You can control which spot in the cell that is by setting the GridSnapCellSpot property.
so… you want to override Location on the node and return the icon.Center.
note you have to override by the get and set or things get weird.
so, it’s going to be something like this:
public override PointF Location {
get { return this.Icon.Center; }
set { this.Icon.Center = value; }
}