I'm creating a modified textbox and want to intercept the delete key. As a starting point I used the numeric-only Textbox example given on pages 438-441 of [u]Professional
VB.Net 2nd ed.</u>
I am able to write code that handles the backspace key without any problem, but not the delete key.
If I add a line at the top of the keypress eventhandler to write the key pressed to the output window, the delete key does not register as a keypress, however the textbox behaves correctly (deleting the character to the right of the cursor.) Pressing alphanumeric keys and the backspace key result in the appropriate value being printed in the output window and in the textbox (if it is one I'm not discarding.)
Does
vb.net handle the delete key as a keypress event?
As I want to set some properties of the control based upon the contents of the textbox, I want to be able to update the properties when the user alters the text by repositioning the cursor and then deleting text to the right of the cursor.
Ideally, I'd like to know when the user has pressed the delete key so I can check if deleting the character to the right will require a change in one of the controls properties.
Can this be done easily starting from the textbook example or am I going to have to adopt a different approach?