Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Forms
Hi all,
I have different types of controls in my windows form,when i press enter key it should act as tab..
 
i have written function like
private void keypressevents(KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                SendKeys.Send("{TAB}");
            }
            
        }
 
and called "keypressevents(e)" in form's keypress event.
 
but the result is negative...plz help me..
Posted 1-Jul-13 20:58pm
Edited 1-Jul-13 21:38pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Assuming, that you tagged you your question deliberately with asp.net, and you write windows forms by mistake:
You can't handle this on server side.
You have to do it on client side with JavaScript. Read these:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=538[^]
http://paulwerickson.com/jquery-how-to-tab-with-the-enter-key/[^]
 
Assuming, that you tagged you your question by mistake with asp.net, and you write windows forms deliberately:
Look here: Redirect the Enter key from a Windows Forms TextBox[^]
  Permalink  
v2
Comments
Member 10050742 at 2-Jul-13 2:23am
   
sorry i have mistaken,actually it's a windows application not asp.net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 2 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100