Search
DiagramNode.Constraints Property
See Also
 





Allows applying constraints to the location and size of the node.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public NodeConstraints Constraints { get; set; }

Visual Basic  Copy Code

Public Property Constraints As NodeConstraints

 Property Value

An instance of the NodeConstraints class.

 Remarks

These constraints are considered when a user modifies the node interactively. They are ignored if node placement is changed programmatically by using methods and properties.

 Example

This sample code disables moving or resizing a node vertically:

C#  Copy Code

DiagramNode node = diagram.ActiveItem as DiagramNode;

// Allow moving the node only horizontally
node.Constraints.MoveDirection = DirectionConstraint.Horizontal;

// Disable handles that can be used to resize the node vertically
node.EnabledHandles = AdjustmentHandles.Move |
    AdjustmentHandles.ResizeMiddleLeft | AdjustmentHandles.ResizeMiddleRight;

Visual Basic  Copy Code

Dim node As DiagramNode = diagram.ActiveItem

' Allow moving the node only horizontally
node.Constraints.MoveDirection = DirectionConstraint.Horizontal

' Disable handles that can be used to resize the node vertically
node.EnabledHandles = AdjustmentHandles.Move + _
    AdjustmentHandles.ResizeMiddleLeft + AdjustmentHandles.ResizeMiddleRight

 See Also