Results 1 to 6 of 6

Thread: Multi Undo Multi TextBoxes

  1. #1

    Thread Starter
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284
    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)
    ~* )v( ! /< E *~

  2. #2
    Guest
    Here is the link to what your looking for.

  3. #3

    Thread Starter
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284
    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.
    ~* )v( ! /< E *~

  4. #4
    Guest
    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

  5. #5

    Thread Starter
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284
    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.
    ~* )v( ! /< E *~

  6. #6
    Guest
    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
  •  



Click Here to Expand Forum to Full Width