Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TextBox - ENTER versus TAB
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Divers
Thread ID:
01048463
Message ID:
01048470
Vues:
15
Hey, Cecil,

If you subclass the textbox (something Bonnie suggested a few days ago), you can implement this behavior in your base textbox class, by checking if a keystroke was an enter key, and using SendKeys to push a TAB in.

Basically, you'll need to define an event handler for the Keydown event...
public class MyTextBox : System.Windows.Forms.TextBox
{
   public MyTextBox()
   {
	this.KeyDown	+= new KeyEventHandler(OnKeyDown);
    }

   public void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
    {
	if (e.KeyCode == Keys.Enter) 
		SendKeys.Send("{TAB}"); 
    }
}
I see you have PUTM membership....if you do searches on some of the keywords here, you'll find several solutions on this...

Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform