C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Moving To Nextcontrol by pressing Enter Instead of tab


Posted Date: 11 Sep 2008    Resource Type: Code Snippets    Category: VB.NET Syntax

Posted By: Initiotech       Member Level: Gold
Rating:     Points: 7



This Code Will make your application move to the next control by pressing enter.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress, TextBox3.KeyPress, TextBox4.KeyPress
If Keys.Enter Then
SelectNextControl(sender, True, False, False, True)
End If
End Sub

Note that you can add the same event to many controls by using ",".
In This Example I have coded on TextBox1 But the event is fired by all the textboxes because i have added these codes
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress, TextBox3.KeyPress, TextBox4.KeyPress


NOTE : That you have to set TabIndex in order.
================================================================================
Download Sample Application.
================================================================================
Regards Hefin Dsouza


Attachments

  • Download Sample (20967-11107-useEnterToMoveNext.rar)



  • Responses


    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Using enter to navigate betwen controls  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Reading CSV file and Displaying data in a Datagrid.
    Previous Resource: Linq To Display Only Even Numbers From an Array
    Return to Discussion Resource Index
    Post New Resource
    Category: VB.NET Syntax


    Post resources and earn money!
     
    Related Resources



    dotNet Slackers   BizTalk Adaptors    Web Design

    doors in nj

    Contact Us    Privacy Policy    Terms Of Use