darkpomix
asked on
how can i simulate a Progress bar in c# (Visual Studio.net)
how can i simulate a Progress bar in c# (Visual Studio.net), please help, with this , i try for many times but dont work, if any can help me ????
ASKER
no , i use a simple progressbar that is included in vs.net , and i need to simulate a process ,
Your question isn't making much sense, darkpomix. What are you trying to simulate? Can you give an example? Are you trying to inherit the progress bar to create your own control? Please be more specific.
Thanks.
Jason
Thanks.
Jason
ASKER
only simulate a process, with a counter i guess, the progress need to fill up the progressbar, with a standard progressbar, not my own , thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Something a little more "fluid":
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
Random R = new Random();
progressBar1.Value = progressBar1.Minimum;
for (int i = progressBar1.Minimum; i < progressBar1.Maximum; i++)
{
System.Threading.Thread.Sl eep(R.Next (50, 250));
progressBar1.Increment(1);
Application.DoEvents();
}
MessageBox.Show("Done");
button1.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
Random R = new Random();
progressBar1.Value = progressBar1.Minimum;
for (int i = progressBar1.Minimum; i < progressBar1.Maximum; i++)
{
System.Threading.Thread.Sl
progressBar1.Increment(1);
Application.DoEvents();
}
MessageBox.Show("Done");
button1.Enabled = true;
}
Are you trying to simulate some kind of process with a normal progressbar?
Or do you want to make you own progressbar?
?...