title: Progress Bar with process
body: <p>When i click my command button it takes a few seconds to complete the process which could make the end users think the program is lagging, then i thought of the progress bar. so how can make the progress bar work while the process is running so that the users will not think that the program is lagging, i'm new to vb.net, i research quiet some time now and still can't get how it works nor how will i start.</p>
  
  <p>thanks for the help in advance  </p>
  
  <p>this is my command button process.</p>
  
  <pre><code>        Private Sub LoginBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBTN.Click
      Using ClientDashboardx As New ClientDashboard
          Try
  
              cn = New ADODB.Connection
              conDB()
              cn.Open()
  
              rs = New ADODB.Recordset
              rs.Open("SELECT * FROM tb_registration", cn, 0, 3)
  
              If txtuserid.Text = "" Or txtuserpass.Text = "" Then
                  MsgBox("Value Null")
                  Exit Sub
              Else
                  Do While Not rs.EOF
                      Dim strLogin = txtin.Text
                      Dim strLogout = txtout.Text
                      If rs("st_acc_number").Value = txtuserid.Text And rs("st_password").Value = txtuserpass.Text And rs("st_log").Value = strLogin Then
                          MsgBox("Account in use")
                          Exit Sub
                      ElseIf rs("st_acc_number").Value = txtuserid.Text And rs("st_password").Value = txtuserpass.Text And rs("st_log").Value = strLogout Then
                          Dim strID = rs("st_acc_number").Value
                          Dim strUserName = rs("st_fname").Value &amp; " " &amp; rs("st_lname").Value
                          Dim strTotalTime = rs("st_totaltimeleft").Value
                          rs.Close()
                          SaveAccNumber.Text = strID
                          SaveUserName.Text = strUserName
                          SaveTotalTime.Text = strTotalTime
  
                          cn.BeginTrans()
                          cn.Execute("UPDATE tb_registration SET st_log='in' where st_acc_number='" &amp; SaveAccNumber.Text &amp; "'")
                          cn.CommitTrans()
                          cn.Close()
  
                          ClientDashboardx.id_lbl.Text = SaveAccNumber.Text
                          ClientDashboardx.iduser_lbl.Text = SaveUserName.Text
                          ClientDashboardx.UserTotalTime.Text = SaveTotalTime.Text
                          ClientDashboardx.AutoUpdate_Button.Enabled = True
                          Me.Hide()
                          ClientDashboardx.ShowDialog()
                          Me.Show()
                          Exit Sub
                      Else
                          rs.MoveNext()
                      End If
                  Loop
                  MsgBox("User/Pass Mismatch")
                  Exit Sub
              End If
          Catch ex As Exception
              MsgBox("Server Offline", MsgBoxStyle.Critical, "")
          End Try
      End Using
  End Sub
  </code></pre>