Hi stoyo,
Thanks to reply back. Your solution is working fine with effects but not with the order of control.
And I have some problem with Following another scenario :-
1 Lock the control
I am using this code:-
Private Sub LockAllNodes(ByVal Locked As Boolean)
On Error Resume Next
Dim Lop As Long
For Lop = 1 To diagram.Nodes.Count - 1
If diagram.Nodes(Lop).Id <> BackgroundID Then
diagram.Nodes(Lop).Locked = Locked
SetWithUndo(diagram.Nodes(Lop))
End If
Next Lop
End Sub
when insert control on the diagram and resize it I have write this code on "NodeModified" event. Code is here:-
SetWithUndo(e.Node)
then lock the control and perform undo operation.
Problem is it is not sequenced, Click on undo button, Control is not unlock and again click on undo button then directly gets resize not unlock. sometimes i have to click more times on undo button then
undo operation is working.
Our project requirement is undo and redo button should be disabled if there is no changes made on diagram and if changes made then undo redo button should be enabled and disabled with respect to each other. for this i have written this code :-
Private Sub UndoRedo_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
On Error Resume Next
Select Case sender.name.ToString
Case "cmdUndo"
If diagram.CanUndo = True Then diagram.Undo()
cmdRedo.IsEnabled = True
Case "cmdRedo"
If diagram.CanRedo = True Then diagram.Redo()
End Select
Next
End Sub
But sometimes redo button is disabled while no of redo operation is pending to be performed. Because of i am using This method:-
SetWithUndo(selectedNode)
Please suggest me something to over come of these problems.
Thanks in advanced.