



Public Class login
   

    Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
       
        qry("select pass from login where nm='" & TextBox1.Text & "'")


        If dr.Read = True Then
            If dr.Item(0).ToString = TextBox2.Text Then
                PictureBox4.Visible = True
                ProgressBar1.Visible = True
                ProgressBar1.Value = 100
                ProgressBar1.Maximum = 1000

                Timer1.Enabled = True
                MsgBox("Login Successfull")
            Else
                PictureBox4.Visible = True
                MsgBox("Invalid password")

            End If
        Else
            MsgBox("Invalid name")
        End If


        dr.Close()

    End Sub

    Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
        Me.Close()

    End Sub

    Private Sub login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cont()
        PictureBox4.Visible = False
        ProgressBar1.Visible = False
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Value = ProgressBar1.Value + 30
        If ProgressBar1.Value = 1000 Then

            Timer1.Enabled = False
            MainForm.Show()
            Me.Hide()

        End If
    End Sub

  
    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        forgot.Show()

    End Sub
End Class
