c# - Cannot disable beep sound on textbox keydown event -


below code disabling beep sound when press "enter" on textbox keydown() event:

if (e.keycode == keys.enter) {     e.suppresskeypress = true;     savedata();     e.handled = true; } 

but keeps beeping when press "enter" on textbox. doing wrong?

sorry, realised have messagebox displaying.

what can have timer , have fire off savedata() method.

private void timer1_tick(system.object sender, system.eventargs e) {     timer1.enabled = false;     savedata(); } 

then in textbox keypress event, this:

if (e.keycode == keys.enter) {     e.suppresskeypress = true;     timer1.enabled = true; } 

that seems work...


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -