Tutorials‎ > ‎VB Tutorials‎ > ‎

Trap The Enter Key In VB.Net

posted Jan 14, 2010, 8:33 PM by Tim Key   [ updated Jan 14, 2010, 8:36 PM ]

All you need to do is copy and past the segment of code below into the keypress event of the control.


        If Asc(e.KeyChar) = Keys.Enter Then
            'Do something here

            e.Handled = True
        End If



That's it, I hope you find it useful...