Results 1 to 2 of 2

Thread: textbox: do inset/overkey key

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    textbox: do inset/overkey key

    hi all
    using the TextBox , what is the easiest way to make the INS
    key operate as it should?
    (ie toggle between insert or overtype modes for text entry)

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Do this...
    VB Code:
    1. Dim InsKey As Boolean
    2.  
    3. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    4. If KeyCode = vbKeyInsert Then
    5.     InsKey = Not InsKey
    6. End If
    7. End Sub
    8.  
    9. Private Sub Text1_KeyPress(KeyAscii As Integer)
    10. If InsKey Then
    11.     Text1.SelLength = 1
    12. End If
    13. End Sub

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