Thursday, September 17, 2009

Tips and Tricks Visual Basic 6.0 Undo The Last User Action In Text Box


Add 1 Text Box and 1 Command Button to your form.
Press the button to undo the last user action.


Module Code


Declare Function SendMessageBynum& Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    ByVal lparam As Long)
Public Const EM_UNDO = &HC7&



Form Code

Private Sub TextUndo(T As TextBox)
    SendMessageBynum T.hwnd, EM_UNDO, 0, 0
End Sub
Private Sub Command1_Click()
'replace the "Text1" below with the name of the Text Box you want to
'apply the Undo on it.
   
Call TextUndo(Text1)
End Sub

 

0 comments:

Your Ad Here