wen i press the enter key,i can login.But i face a problem which is there will repeat call the login function when i press enter key a fews times and there got error!
how can i make the enter key is disable after i success login?
thnaks

Private Sub button1_keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TabControl1.KeyDown
        If e.KeyCode = Keys.Enter Then
            Call Button1_Click(sender, Nothing)


        End If

just add another variable boolean and 'if' procedure to make filter, it was login or not yet, hope it will help :D

how to check login o x?
thanks

See if this helps.

Public Class Form1
    Private hasLoggedIn As Boolean = False

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Enter Then
            If hasLoggedIn = False Then Button1_Click(sender, e)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If hasLoggedIn = False Then
            hasLoggedIn = True
            MsgBox("Button1_Click")
        End If
    End Sub

End Class
This question has already been answered. Start a new discussion instead.