Prod.: Engine, ver.: 6, ID: 60000282, HowTo : How can I zoom/pan without adding these actions to Undo/Redo

HowTo : How can I zoom/pan without adding these actions to Undo/Redo

Article60000282
TypeHowTo
ProductEngine
Version6
Date Added10/24/2007
Submitted byPDHelly
Keywords

Subject

How can I zoom/pan without adding these actions to Undo/Redo

Summary

How can I zoom/pan without adding these actions to Undo/Redo list using the .NET components.

Solution

You can use the onUndoStoreValue of the vdDocument event and when the ViewSize or ViewCenter changes (this happens with zoom and/or pan) then set the Cancel to true. Like : 

private void Form1_Load(object sender, EventArgs e)
{
   vdFramedControl1.BaseControl.ActiveDocument.OnUndoStoreValue += new VectorDraw.Professional.vdObjects.vdDocument.UndoStoreValueEventHandler(ActiveDocument_OnUndoStoreValue);
}

void ActiveDocument_OnUndoStoreValue(object sender, bool isRedo, object propObject, string propName, object value, ref bool Cancel)
{
if (propName.ToLower() == "viewcenter" || propName.ToLower() == "viewsize")
   {
// zoom & pan change ViewCenter and ViewSize
      
Cancel = true; // This will not write to the UNDO the pan/zoom actions
   }
}