TextBox does not accept Return

  • Thread starter Thread starter Ralf Neubert
  • Start date Start date
R

Ralf Neubert

Hello,

I'm working with Visual Studio .NET 2003 and Compact
Framwork 1.1 (C#).
How can I make my TextBoxes accept Return to fire the
Validating-Event and set the focus to another TextBox?

Thanks
Ralf
 
Trap the KeyDown event and write something like this:


private void textBoxArticolo_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Return)
do something
}
 
Hi Ralf,

Unfortunately capturing the Enter key is not supported in the .NET CF by
default. We have developed a set of controls that extend the functionality
to include what you are looking for, as well as other features.

If you decide to purchase, we only sell you the features that you request
from our Feature Tree, thus reducing the size of the installed file on your
device. You can download a trial version of the Dynamic Framework at
www.mcsoft.com.au.

Cheers
Andrew
 
or you can do a keypress event which i think is better
but any how the code is:

if(e.KeyCode == (char)13)
{
textBox2.focus();
}
 
Back
Top