Hi There,
I am developing VB.NET 2003 window application having problem with the FORM KEYDOWN event.
Problem with cancelling the keydown event when the data check function return FALSE due to duplicate Debtor ID.
How to cancel the KeyDown
[B]Private Sub FrmDebtor_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Tab Or e.KeyCode = keys.Enter Then
If Me.TabIndex = 1 Then
If FCheckDuplicate = True Then
e.KeyCode = Keys.Cancel
End If
End If
End If
End Sub[/B]