Search
Box.Constraints Property
See Also
 



Gets or sets the constraints applied to the location and size of this box.

 Syntax

VB6  Copy Code

Public Property Get Constraints( _
    ByVal constraint As ENodeConstraint _
) As Integer
Public Property Let Constraints( _
    ByVal constraint As ENodeConstraint, _
    ByVal Value As Integer _
)

C++  Copy Code

public:
short get_Constraints (
    ENodeConstraint constraint
)
void put_Constraints (
    ENodeConstraint constraint,
    short value
)

 Parameters

constraint
A value from the ENodeConstraint enumeration.

 Property Value

A short value.

 Remarks

Allows applying constraints to the location and size of a box. These constraints are considered when a user modifies the box interactively. They are ignored if box placement is changed programmatically via methods and properties. Currently, the following constrains can be set:

Constraint index

Value

ncMoveDirection

0 - no movement constraints;
1 - users can move the box only horizontally;
2 - users can move the box only vertically;

ncMinWidth

0 - no constraints;
any other value specifies the minimal box width allowed;

ncMinHeight

0 - no constraints;
any other value specifies the minimal box height allowed;

ncMaxWidth

0 - no constraints;
any other value specifies the maximal box width allowed;

ncMaxHeight

0 - no constraints;
any other value specifies the maximal box height allowed;

ncKeepInsideDiagram

0 - no constraints;
otherwise the user is prevents from dragging nodes outside of the flowchart boundaries;

 Example

This sample disables moving or resizing a box vertically.

VB6  Copy Code

' allow moving the box only horizontally
fcx.ActiveBox.Constraints(ncMoveDirection) = 1

' disable handles that can be used to resize the box vertically
' binary 110100000: bit 8 = move handle; bits 5 & 7 = left & right resize handles
fcx.ActiveBox.MnpHandlesMask = 416

 See Also