By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

textbox event on 'delete' key

P: n/a
I am trying to create a custom text box that performs a function on
every key press, and it works perfectly, except that the 'delete' key
(and the arrow keys) does not fire an event.

textBox1_KeyPress is called on every other key, including backspace,
but delete simply deletes a character from the text in the box and
does not fire the event. How can I catch this keypress?

Any help would be appreciated...

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
KeyPress event may not be useful for non-character keys. Use KeyDown or
KeyUp event for the same.

+Rajesh R

"Cystm" <eh*******@mindspring-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
I am trying to create a custom text box that performs a function on
every key press, and it works perfectly, except that the 'delete' key
(and the arrow keys) does not fire an event.

textBox1_KeyPress is called on every other key, including backspace,
but delete simply deletes a character from the text in the box and
does not fire the event. How can I catch this keypress?

Any help would be appreciated...

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 16 '05 #2

P: n/a
Hi,
KeyPress handles only character key presses. For Del, you will have to
handle KeyUp or KeyDown events.

HTH.

"Cystm" <eh*******@mindspring-dot-com.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
I am trying to create a custom text box that performs a function on
every key press, and it works perfectly, except that the 'delete' key
(and the arrow keys) does not fire an event.

textBox1_KeyPress is called on every other key, including backspace,
but delete simply deletes a character from the text in the box and
does not fire the event. How can I catch this keypress?

Any help would be appreciated...

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #3

P: n/a
Thanks! Works perfectly!

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.