VB.NET 2008 で KeyPress イベントを使用しようとしていますが、機能していません。このコードの何が問題なのか、誰か教えてもらえますか? このメッセージ ボックスは表示されず、DB からのステータスも表示されません。プログラムは問題ないと言っていますが、動作していません。
If e.KeyChar = Chr(Keys.Enter) Then
tblLogin = Proses.ExecuteQuery("Select * From TblUser where kode_user = '" & KdUserTxt.Text & "'")
If tblLogin.Rows.Count = 0 Then
MessageBox.Show("Kode User Not Found!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
KdUserTxt.Focus()
Else
StatusTxt.Text = tblLogin.Rows(0).Item("status")
PswTxt.Focus()
End If
End If