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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Aug 7, 2011, 1:09 PM
Hirendra SisodiyaPosted Aug 7, 2011, 6:45 AM
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 HobbsPosted Aug 6, 2011, 3:39 PM
Mayur GujrathiPosted Aug 6, 2011, 7:22 AM
protected override bool ProcessDialogKey(Keys keyData)
{
switch (keyData)
{
case Keys.Enter:
return base.ProcessDialogKey(Keys.Tab);
}
return base.ProcessDialogKey(keyData);
}
Om prakash SinghPosted Aug 6, 2011, 6:18 AM
{
if(e.keychar=='\r')
e.keychar="key code of tab key";
}