textbox autocomplete return character keypress problem
-
Hi, I was using the return character to evaluate the input of a textbox via the keypress event. private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { e.Handled = true; } } After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this? Thanks
Karl
-
Hi, I was using the return character to evaluate the input of a textbox via the keypress event. private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { e.Handled = true; } } After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this? Thanks
Karl
when you use autocomplete and choose a text from the autocomplete list, its sure that it wll not trigger the keypress event because you are not pressing keys onthe keyboard. try validating the text in the textbox again before you will use it.
Signature has been encrypted
-
when you use autocomplete and choose a text from the autocomplete list, its sure that it wll not trigger the keypress event because you are not pressing keys onthe keyboard. try validating the text in the textbox again before you will use it.
Signature has been encrypted
Thanks for your reply. It doesn't matter if the text is chosen from the autocomplete list or the person is typing in something completely new. The return key never fires a keypress event anymore. Every other key fires the event. The return key instead causes the text to be highlighted. I am not sure what you mean by validating the text in the textbox before using it. I currently do not validate the text, anything can be entered in the box. Thanks.
Karl
-
Hi, I was using the return character to evaluate the input of a textbox via the keypress event. private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { e.Handled = true; } } After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this? Thanks
Karl
After further investigation it turns out that auto complete only intercepts the keypress event for the return key. The keypress event gets fired appropriately with any other key. The other keyboard events such as keyup and keydown are unaffected by this issue so they can be used as a work around. If anyone knows more about this issue please reply.
Karl