Set Enter key for windows form
how can i set enter key (like tab) for windows form in c sharp
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Om prakash Singh126 reputationPosted Aug 6, 2011, 2:18 AM EDT
{
if(e.keychar=='\r')
e.keychar="key code of tab key";
}
Mayur GujrathiRank #666 · 3.6K reputationPosted Aug 6, 2011, 3:22 AM EDT
protected override bool ProcessDialogKey(Keys keyData)
{
switch (keyData)
{
case Keys.Enter:
return base.ProcessDialogKey(Keys.Tab);
}
return base.ProcessDialogKey(keyData);
}
Sam HobbsRank #107 · 20.5K reputationPosted Aug 6, 2011, 11:39 AM EDT
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Aug 7, 2011, 2:45 AM EDT
if (e.KeyData == System.Windows.Forms.Keys.Enter)
{
SendKeys.Send("{TAB}");
}
i think it is very useful for you try this:
http://www.authorcode.com/how-to-set-enter-key-as-tab-in-windows-form-in-c/
Sam HobbsRank #107 · 20.5K reputationPosted Aug 7, 2011, 9:09 AM EDT