Performs Redo action in the current editor mode (design or source).
Namespace:
C1.Win.XmlEditorAssembly:
C1.Win.XmlEditor.2 (in C1.Win.XmlEditor.2.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Sub Redo |
Examples
This example shows how to create a custom context menu that can be linked to a C1XmlEditor control and has Undo and Redo buttons.
Copy CodeC#
class MyContextMenuStrip : ContextMenuStrip
{
private C1XmlEditor _owner;
private ToolStripMenuItem _btnUndo, _btnRedo;
public MyContextMenuStrip(C1XmlEditor editor)
{
_owner = editor;
_btnUndo = (ToolStripMenuItem)Items.Add("Undo");
_btnUndo.ShortcutKeys = Keys.Control | Keys.Z;
_btnRedo = (ToolStripMenuItem)Items.Add("Redo");
_btnRedo.ShortcutKeys = Keys.Control | Keys.Y;
}
protectedoverridevoid OnItemClicked(ToolStripItemClickedEventArgs e)
{
Close();
if (e.ClickedItem == _btnUndo)
_owner.Undo();
elseif (e.ClickedItem == _btnRedo)
_owner.Redo();
base.OnItemClicked(e);
}
protectedoverridevoid OnOpening(System.ComponentModel.CancelEventArgs e)
{
_btnUndo.Enabled = _owner.CanUndo;
_btnRedo.Enabled = _owner.CanCut;
base.OnOpening(e);
} |
See Also