UndoManager提供PerformUndoAction接口,你可以通过代码将需要undo的行为添加的UndoManager中。 以Drag Fill 为例:- this.fpSpread1.AllowUndo = true;
- this.fpSpread1.ActiveSheet.Cells[0, 0].Text = "DragFill";
- this.fpSpread1.ActiveSheet.FillRange(0, 0, 2, 2, 4, FillDirection.Down);
- this.fpSpread1.UndoManager.PerformUndoAction(new CellDragFillUndoAction(this.fpSpread1.ActiveSheet, 0, 0, 2, 2, 4, FillDirection.Down, false));
复制代码
Cells note操作同理。对应的UndoAction,请查看帮助文档中UndoAction NameSpace章节。 |