Public Class Form1
    Dim i As Integer = 0
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.Hide()

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "parolaPAG" Then
            Me.Hide()
            Form2.Show()
            i = 0
        Else
            i = i + 1
            Me.TextBox1.Focus()
            Me.TextBox1.SelectionStart = 0
            Me.TextBox1.SelectionLength = Len(TextBox1.Text)
        End If
        If i = 3 Then
            Me.Close()
            Form2.Close()

        End If
    End Sub

  
    Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Return Then
            Button1.PerformClick()
        End If
    End Sub
End Class