Here is an example to capture the enter key.
protected override bool ProcessCmdKey( ref Message msg, Keys keyData )
{
if( keyData == Keys.Enter )
{
MessageBox.Show( "Enter pressed!" );
return true;
}
return base.ProcessCmdKey( ref msg, keyData );
}
Hope this helps
Publicjoe
C# Tutorial at
http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at
http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
"Dave Veeneman" <da****@nospam.com> wrote in message
news:e#**************@TK2MSFTNGP12.phx.gbl...
Is there a simple way to prevent the system from beeping when I hit the
Enter key in a single-line text box?
I'm trapping the KeyDown event to intercept the key press and advance the
focus to the next control. But I still get an annoying beep. Any way to
silence it? Thanks
--
Dave Veeneman
Chicago