How to Make ENTER Key Work Like the TAB key When the User Key Down?
Posted on 2009-04-14
I am using VS.NET 2005 with VB.NET to make a WinForms application. I would like to make the Enter key=Tab key. I am using the .NET DataGridView control and when the user key presses the Enter key; it creates a new row. I would like to prevent this by making the Enter key act like the Tab key. Unfortunately the code I tried does not work and when the user key presses the Enter key; it still creates a new row as follows:
Private Sub GrdPODetail_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles grdPODetail.KeyDown
If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True