Occurs when the undo or redo buffer changes.
Syntax
Visual Basic (Declaration) | |
---|
Public Event UndoRedoChanged() As EventHandler |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
Dim handler As EventHandler
AddHandler instance.UndoRedoChanged, handler
|
Managed Extensions for C++ | |
---|
public: __event EventHandler* UndoRedoChanged(); |
Example
This example updates an Undo and Redo menu handler's status.
Visual Basic | Copy Code |
---|
Public Sub AnnAutomation_UndoRedoChanged(ByVal manager As AnnAutomationManager)
For Each automation As AnnAutomation In manager.Automations
AddHandler automation.UndoRedoChanged, AddressOf automation_UndoRedoChanged
Next automation
End Sub
Private Sub automation_UndoRedoChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim automation As AnnAutomation = CType(IIf(TypeOf sender Is AnnAutomation, sender, Nothing), AnnAutomation)
_menuItemUndo.Enabled = automation.CanUndo
_menuItemRedo.Enabled = automation.CanRedo
End Sub |
C# | Copy Code |
---|
public void AnnAutomation_UndoRedoChanged(AnnAutomationManager manager) { // subscribe to the UndoRedoChanged event of all automations foreach(AnnAutomation automation in manager.Automations) automation.UndoRedoChanged += new EventHandler(automation_UndoRedoChanged); } private void automation_UndoRedoChanged(object sender, EventArgs e) { AnnAutomation automation = sender as AnnAutomation; // assume _menuItemUndo is the Undo menu, and _menuItemRedo is the Redo menu _menuItemUndo.Enabled = automation.CanUndo; _menuItemRedo.Enabled = automation.CanRedo; } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also