private void FormMain_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r') buttonEnter_Click(sender, e);
}
Both FormMain and textBoxInput are linked to this function.
Thanks a bunch in advance!
edit: make sure you can hear the sound in the vid.
[Edited by - geekalert on September 14, 2006 8:54:01 PM]
C# unnecessary noises
well, i was wondering how you would fix this particular problem: every time I press enter, the text box makes a beeping "invalid input noise". Eventually this gets really annoying for the user, and I was wondering how to fix this so it is silent.
also, if a picture is worth 1000 words, how much is a video worth? ;)
clicky
the source language is C#, and the key handling code goes as such:
You set the default button for the form as equals right? The default button will get called when you press enter. Unless your text box has been set to allow enter.
I believe KeyPressEventArgs contains a .Handled member, which lets your event handler indicate that the event was handled but your code.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement