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 EM_UNDO = &HC7 Private Sub Command1_Click() SendMessage Text1.hwnd, EM_UNDO, 0, 0 End Sub 帮忙: http://expert.csdn.net/Expert/topic/1920/1920488.xml?temp=.2551386
Const EM_UNDO = 199 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 SendMessage RichTextBox1.hwnd, EM_SETMODIFY, 0, 0
如果要撤销多步,那一两句说不清,基本思想就是把用户的所有操作都记录下来,撤销的时候反过来作就行了
Private Const EM_UNDO = &HC7
Private Sub Command1_Click()
SendMessage Text1.hwnd, EM_UNDO, 0, 0
End Sub
帮忙:
http://expert.csdn.net/Expert/topic/1920/1920488.xml?temp=.2551386
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
SendMessage RichTextBox1.hwnd, EM_SETMODIFY, 0, 0