Oh dear, it doesn't work fine after all.
All is well as long as arrows are either autorouted or not autorouted.
However, when I call Route() (on an autorouted arrow) and then disable its "autoroute" property. It seems that the start and enpoint are no longer the first and last point in the controlpoints the collection.
Is there another way to figure out which two points are the enpoint of an arrow? So I can decide NOT to move those two?
I'm doing it like this now:
c = Me.mFlowChart.Selection.Arrows.Count
For i As Integer = 0 To c - 1
Dim lArrow As Arrow = CType(Me.mFlowChart.Selection.Arrows(i), Arrow)
For j As Integer = 1 To lArrow.ControlPoints.Count - 2
lArrow.ControlPoints(j) = New PointF(lArrow.ControlPoints(j).X + iDx, lArrow.ControlPoints(j).Y + iDy)
Next
If lArrow.AutoRoute Then
lArrow.Route()
End If
lArrow.UpdateFromPoints()
Next
There's another problem that relates to changing from autoroute to not autoroute.
So I have my arrow and I set it to autoroute, it gets rerouted perfectly fine. Then I disable autoroute. The arrow still looks fine. Now when I move a box around, alle points of the arrow except the two endpoints are removed. So I end up with an arrow of 1 segment.
What I want to happen is that the arrow stays in the form the autoroute had put it.
What I'm thinking of doing is calling Route() when I disable autoroute as well... however, then any changes to the segments of the arrow would have to be disabled when in autoroute mode. At this time, one can add segments with auto routing on. Calling Route() again will remove those segments again. Wanted behavior would be that if the user has added some segments and then disables autoroute, the segments remain.