I have a text edit field in a Windows Form C# application I am developing and after the function occurs, windows dings. I found some solutions but it applied only to C++ and I couldn't figure how to translate it making the key event to zero since it is a char and illegal cast, even if i do manually cast it to char, it still beeps.
Any help is greatly appreciated!
private void txtPhrase_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
// keyPress seems to initiate the system beep. Why?
btnSpeak_Click(sender, e);
}
}
You have to prevent the keystroke from reaching the native control. Set e.Handled = true