In this Blog, we will see how to use ProgressBar control in a Windows Forms using Visual Studio 2005. We will also use Timer & BackgroundWorker in a forms.
![]()
ProgressBar : Displays a bar that fills to indicate to the user the progress of an operation.
![]()
Timer : Component that raises an event at user defined intervals.
![]()
BackgroundWorker : Executes an operation in a separate thread.
Here, we will use these controls for Windows application at Login Authentication operation.
Let's Start to Windows Application.
Drag ProgressBar, Timer & Backgroundworker to windows form,
Write code to btnLogin
if
(txtLogin.Text == "ADMIN" && txtPass.Text ==
"PASS")
{
timer1.Enabled =
true;
timer1_Tick(sender, e);
panel2.Enabled =
true;
panel3.Enabled =
true;
lblTime.Text =
Convert.ToString(DateTime.Now.TimeOfDay).Substring(0,
8);
lblDate.Text =
Convert.ToString(DateTime.Now.Date).Substring(0,
11);
}
else
{
MessageBox.Show("Please Enter Right password
and username");
}



Join the conversation! Your thoughts help the community grow.