?
Solved

Catch enter button

Posted on 2007-07-22
1
Medium Priority
?
240 Views
Last Modified: 2013-11-26
Hi
Need some help to catch a keypress

If I press Enter button in a numeric box I want to do som stuff..

How do I catch it
0
Comment
Question by:AWestEng
1 Comment
 
LVL 3

Accepted Solution

by:
lorelogic earned 2000 total points
ID: 19543626
Use the KeyDown event of the control to capture the keys when they are pressed. The KeyDown event occurs before the KeyPress event. Here is an example of code to place in the KeyDown Event of the control:

Private Sub textBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) _  
   If (e.KeyCode = Keys.Enter) Then
       DoSomething....
   End If
End Sub 'textBox1_KeyDown
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
An ASP.NET Web Form User Control is not newly introduced in ASP.NET. In fact, it was an old technology yet still playing a role to generate web content, especially when we want to use it to have a better and easy way to control part of the web conte…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question