Results 1 to 2 of 2

Thread: Turning off Ctrl+Z?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4
    Has anyone got any idea how to turn off the automatic Undo through Ctrl+Z on a RichTextBox control? I want to add a menu item with Ctrl+Z for my own, multiple, undo.

    Cheers
    from Starsky
    VB6 Pro SP3
    I'm not stupid, I just don't post a lot. No, really...

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Sure! Just check for it in the KeyDown event:
    Code:
    Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyZ And (Shift And vbCtrlMask) = vbCtrlMask Then
            KeyCode = 0
        End If
    End Sub
    Good luck!

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