Search Tools Links Login

Professional Multiple Undos Class for RichTextBoxes v1.03 [UPDATED 05/01/2002]


I've tried a lot of different multiple undo examples from the Inet, but every had at least one draw back. So I had to write my on solution and I think this one is quite smart. If you want to use it, you don't have to clutter your code by pasting in lots of undo-related subs, functions and variables. Everything comes within two handy class files and you only need to add three lines of code to your VB projects. -- I didn't test the code on VB5.0, would be cool if anybody can give a feedback on that. -- NEW: a single undoitem now stores only the modifications and not the whole text --> that is important when working with bigger files. -- NEW: now you can turn off the automatical tracking of text changes --> may be useful on automated text operations. -- NEW: Speed improvements. New properties getUndoCount and getRedoCount. Now you can undo/redo multiple changes with one function call. -- Thanks to MrBobo for his ideas and suggestions. -- -- Have a look at the latest version supporting standard textboxes too: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=34335&lngWId=1

Original Author: Sebastian Thomschke

API Declarations

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 Declare Function InvalidateClientRect Lib "user32" Alias "InvalidateRect" _
(ByVal hWnd As Long, ByVal lpRect As Long, ByVal bErase As Long) As Long
Private Const WM_SETREDRAW = &HB
'These API declarations are only used for
'the example and not part of the undo
'class itself:
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_CUT = &H300
Private Const WM_COPY = &H301
Private Const WM_PASTE = &H302

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 77 times

Categories

Visual Basic 6

Attachments

Profession78405522002.zip
Posted: 9/3/2020 3:45:00 PM
Size: 16,953 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.