CPIndexToAttach: Integer;
The CPIndexToAttach property returns the index of the object workspace connecting point, to which the end point of the connecting line was joined after the shift.
Executing the example requires a form with the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1 component. The specified procedure is a handler of the OnAfterMoveCP event.
Add links to the Andy, Collections, ExtCtrls, Forms, Ui, and Workspace system assemblies.
Sub WorkspaceBox1OnAfterMoveCP(Sender: Object; Args: IAttachCPEventArgs);
Var
i: Integer;
Begin
If Args.ShapeToAttach <> Null Then
i := Args.CPIndexToAttach;
End If;
End Sub Workspace1BoxOnAfterMoveCP;
After executing the event the i variable will contain index of the workspace object connecting point, to which the end point of the connecting line that generated the OnAfterMoveCP event was joined.
See also: