Windows ding on textbox
-
I have use ENTER key to move focus from current control(textbox, combo,etc) to the next control in the tab index list. I get that done, but windows sound a 'ding' everytime i hit enter. The ding does not sound when TAB or UP-DOWN arrows are used. Ive tried alot of stuff, but i do'nt know why it's sounding, so i ca't really say for shure where to look. How can I disable the 'ding' when using the ENTER key? Andre
-
I have use ENTER key to move focus from current control(textbox, combo,etc) to the next control in the tab index list. I get that done, but windows sound a 'ding' everytime i hit enter. The ding does not sound when TAB or UP-DOWN arrows are used. Ive tried alot of stuff, but i do'nt know why it's sounding, so i ca't really say for shure where to look. How can I disable the 'ding' when using the ENTER key? Andre
InOut.NET wrote:
How can I disable the 'ding' when using the ENTER key?
Check ur Control Panel>>Sound settings.
-
InOut.NET wrote:
How can I disable the 'ding' when using the ENTER key?
Check ur Control Panel>>Sound settings.
-
I have use ENTER key to move focus from current control(textbox, combo,etc) to the next control in the tab index list. I get that done, but windows sound a 'ding' everytime i hit enter. The ding does not sound when TAB or UP-DOWN arrows are used. Ive tried alot of stuff, but i do'nt know why it's sounding, so i ca't really say for shure where to look. How can I disable the 'ding' when using the ENTER key? Andre
You need to catch the control's KeyPress event and set the Handled property of the KeyPressEventArgs to true:
private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
// Check if the user pressed enter (enter = 13)
if (e.KeyChar == 13)
e.Handled = true;
} -
You need to catch the control's KeyPress event and set the Handled property of the KeyPressEventArgs to true:
private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
// Check if the user pressed enter (enter = 13)
if (e.KeyChar == 13)
e.Handled = true;
}