property HTML.AllowUndoRedo as Boolean
Specifies whether the control allows undo/redo actions.

TypeDescription
Boolean A boolean expression that indicates whether the control allows undo/redo actions. 

The control supports multi levels undo/redo support. The CTRL + Z reverses the last htmling action, The CTRL + Y restores the previously undone action. You can invoke any of the following commands: Delete, Copy, Cut, Find, Replace, Incremental Search, FindNext, FindPrev, Paste, Select All, Undo and Redo. Use the AllowContextMenu property to enable the control's context menu. The CanUndo/CanRedo properties specifies whether the control can undo/redo the last operation.

Each command has an unique identifier like follows:

#define ID_HTML_REPLACE						0xE129
#define ID_HTML_DELETE						0xE120
#define ID_HTML_COPY						0xE122
#define ID_HTML_CUT						0xE123
#define ID_HTML_FIND						0xE124
#define ID_HTML_PASTE						0xE125
#define ID_HTML_SELECT_ALL					0xE12A
#define ID_HTML_UNDO						0xE12B
#define ID_HTML_REDO						0xE12C
#define ID_HTML_FINDNEXT						0xE12D
#define ID_HTML_FINDPREV						0xE12E
#define ID_HTML_INCREMENTALSEARCH					0xEA02

You can find all known identifiers on the AllowShortcutFormat property.

The sample requires the definition for SendMessage API function. For instance, the following VB sample calls the Undo command when the user clicks a button.

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_COMMAND = &H111

Private Sub Command1_Click()
    SendMessage HTML1.hwnd, WM_COMMAND, &HE12B * 65536, 0
End Sub

The wParam parameter of SendMessage API function  needs to be Command's Identifier * 65536.

The following C++ sample calls the Redo command when user clicks a button:

void OnButtonRedo() 
{
	m_html.SendMessage( WM_COMMAND, MAKEWPARAM(0, 0xE12C), NULL );
	
}

The  CanUndo property determines whether the last html operation can be undone. The CanRedo property determines if the redo queue contains any actions.

The following VB.NET sample calls the Undo command when the user clicks a button:

<System.Runtime.InteropServices.DllImport("user32.dll")> _
Public Shared Function SendMessage(ByVal hWnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32

End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    With AxHTML1
        .Focus()
        SendMessage(.hWnd, &H111, &HE12B << 16, 0)
    End With
End Sub

The following C# sample calls the Undo command when the user clicks a button:

[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern int SendMessage(int hWnd, int wMsg, int wParam, int lParam);

private void button1_Click(object sender, EventArgs e)
{
	axHTML1.Focus();
	SendMessage(axHTML1.hWnd, 0x111, 0xE12B << 16, 0);
}

The following VFP sample calls the Undo command when the user clicks a button:

DECLARE INTEGER SendMessage IN user32; 
    INTEGER hWnd,; 
    INTEGER Msg,; 
    INTEGER wParam,; 
    INTEGER lParam 

with thisform.HTML1.Object
	SendMessage( .hWnd, 273, BITLSHIFT(57643, 16), 0)
endwith