Click here to Skip to main content
11,578,954 members (65,091 online)
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 19:58pm
Edited 1-Jul-13 20: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 Peter Leow 135
1 Frankie-C 115
2 OriginalGriff 113
3 Richard MacCutchan 85
4 Afzaal Ahmad Zeeshan 85
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 419


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 2 Jul 2013
Copyright © CodeProject, 1999-2015
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