Valhalla Legends Forums Archive | Visual Basic Programming | backspace and delete key

AuthorMessageTime
yuleball
I want to exchange the functioning of backspace and delete key e-g if i press backspace it should delete the character on the right side of cursor and vicee versa for delete key. How can i implement this in rtb?
December 6, 2008, 6:42 AM
l2k-Shadow
to be honest, i think you're going to have to hook into the rtb proc and change the key inputs to bamboozle the rtb into thinking you sent it a delete key instead of a backspace and vice versa.
December 6, 2008, 6:57 AM
Barabajagal
Uh...
[code]Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyBack Then
    KeyCode = vbKeyDelete
  ElseIf KeyCode = vbKeyDelete Then
    KeyCode = vbKeyBack
  End If
End Sub[/code]
December 6, 2008, 10:48 AM
l2k-Shadow
or i guess that will work too :X
December 6, 2008, 3:08 PM
yuleball
Thnx I'll check that
December 7, 2008, 8:43 AM
yuleball
yeah.....it worked. thnx a lot.
December 11, 2008, 9:43 AM

Search