|
-
Sep 23rd, 2000, 04:36 PM
#1
Thread Starter
Hyperactive Member
I know it is possible to do a multi undo. Can you do it with more then one text box though? i've seen some unlimited undo's but they only have to do with 1 text box. I'm looking for some way to make it watch like 3 things on a form or more. Would you know where i might find a good example? (also Redo's too)
-
Sep 23rd, 2000, 05:44 PM
#2
Here is the link to what your looking for.
-
Sep 23rd, 2000, 06:16 PM
#3
Thread Starter
Hyperactive Member
Thats a good example thanks. But thats not what i'm lookin for. I need to know how to do it with like 3 or more text boxes and only 1 undo buttton. How would you make it so it knows what text box was edited last and undo that last one. or the previorsthing before that last undo.
-
Sep 23rd, 2000, 09:02 PM
#4
That was for the multiple undos, which it said it could do (and what you wanted).
But it's also easy to know which textbox was last edited.
Code:
Dim lastedit As Integer
Private Sub Form_Load()
lastedit = 0
End Sub
Private Sub Text1_Change()
lastedit = 1
End Sub
Private Sub Text2_Change()
lastedit = 2
End Sub
Private Sub Text3_Change()
lastedit = 3
End Sub
Private Sub Command1_Click()
If lastedit = 0 Then
Exit Sub 'no textbox edited
ElseIf lastedit = 1 Then
Text1.SetFocus
SendKeys "^z", True
'text1 last edited
ElseIf lastedit = 2 Then
Text2.SetFocus
SendKeys "^z", True
'text2 last edited
ElseIf lastedit = 3 Then
Text3.SetFocus
SendKeys "^z", True
'text3 last edited
End If
End Sub
-
Sep 28th, 2000, 02:51 PM
#5
Thread Starter
Hyperactive Member
That only works if you have Rich text boxes. I take it you can't do it with normal text boxes? Multi undo's on more then one text box (3+ text boxes) with 1 undo button.
-
Sep 28th, 2000, 03:34 PM
#6
I'm afraid not. Textboxes are primitive, whereas RichTextBoxes are advanced. Textboxes have some properties, but RichTextboxes have many more properties. You should use a RichTextBox, if you want much better effects. I think the link I gave showed you how to undo a multiple number of times. Just take it from there and use the lastedit code I gave. Hope that helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|