Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
VB.NET Windows Application (2008)

Hi There ,

What i am looking for i have Key_Press Event on Enter Key,
Now what i want is if user press the key TAB instead of Enter Key ,
I want to fire Enter key Event on same.

Below is my code : Please take a look

And hope you will guide me through this.
VB
Private Sub txtFrt_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtFrt.KeyPress
       If Asc(e.KeyChar) = 13 Then
           calctxt()
           txtBC.Focus()
           txtBC.SelectAll()
       End If
   End Sub

Thanks in Advance.
Posted
Updated 27-Mar-12 3:07am
v2

Hi friend
it is simple to assign enter key act like tab key in key press event.
(important you should assign the tab index properly when we press tab key where the focus go)
SQL
If Asc(e.KeyChar) = 13 Then
                SendKeys.Send("{TAB}")
            End If


i hope u ll understand this code.
 
Share this answer
 
 
Share this answer
 
Comments
gufran90 28-Mar-12 3:12am    
Thanks For your reply @Permalink

But , Friend What i want is

I have already wright the code for Enter key on Keypress event ,

And on press of enter key i am running sum calculation of textboxes etc. (calctxt)

So, what i want is when user press the tab key i want to fire those methodes of
calculate txt etc. and focus to the next control .

Now Please guide me through this...
hope you will understand my problem and i know you can solve it.

Thanks In Advance

Waiting for your reply????????

Please help??????

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900