Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: yuleball on December 06, 2008, 12:42 AM

Title: backspace and delete key
Post by: yuleball on December 06, 2008, 12:42 AM
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?
Title: Re: backspace and delete key
Post by: l2k-Shadow on December 06, 2008, 12:57 AM
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.
Title: Re: backspace and delete key
Post by: Barabajagal on December 06, 2008, 04:48 AM
Uh...
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
Title: Re: backspace and delete key
Post by: l2k-Shadow on December 06, 2008, 09:08 AM
or i guess that will work too :X
Title: Re: backspace and delete key
Post by: yuleball on December 07, 2008, 02:43 AM
Thnx I'll check that
Title: Re: backspace and delete key
Post by: yuleball on December 11, 2008, 03:43 AM
yeah.....it worked. thnx a lot.