Here is the program. The appropriate controls exist in default
configuration on form1. I don't understand why the progressbar
updates, yet the textbox, up/down control, toolStripStatus Label &
label do not. What am I missing here?
Thanks, Tom
using System;
using System.Threadin g;
using System.Windows. Forms;
namespace ProgressBarTest 1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeCompo nent();
}
protected override void OnLoad(System.E ventArgs e)
{
toolStripStatus Label1.Text = "Idling!!!" ;
}
private void UpdateProgressB ar()
{
progressBar1.Vi sible = true;
progressBar1.Ma ximum = 200;
progressBar1.Mi nimum = 0;
progressBar1.St ep = 10;
for (int x = 1; x <= 200; x++)
{
if (x >= 200)
x = 1;
label1.Text = x.ToString();
toolStripStatus Label1.Text = "Incrementing!! !";
numericUpDown1. Text = x.ToString();
textBox1.Text = x.ToString();
progressBar1.Va lue = x;
progressBar1.Pe rformStep();
Thread.Sleep(10 );
}
}
private void btnStart_Click( object sender, EventArgs e)
{
toolStripStatus Label1.Text = "Starting!! !";
UpdateProgressB ar();
}
private void btnClose_Click( object sender, EventArgs e)
{
progressBar1.Di spose();
Application.Exi t();
}
}
}
configuration on form1. I don't understand why the progressbar
updates, yet the textbox, up/down control, toolStripStatus Label &
label do not. What am I missing here?
Thanks, Tom
using System;
using System.Threadin g;
using System.Windows. Forms;
namespace ProgressBarTest 1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeCompo nent();
}
protected override void OnLoad(System.E ventArgs e)
{
toolStripStatus Label1.Text = "Idling!!!" ;
}
private void UpdateProgressB ar()
{
progressBar1.Vi sible = true;
progressBar1.Ma ximum = 200;
progressBar1.Mi nimum = 0;
progressBar1.St ep = 10;
for (int x = 1; x <= 200; x++)
{
if (x >= 200)
x = 1;
label1.Text = x.ToString();
toolStripStatus Label1.Text = "Incrementing!! !";
numericUpDown1. Text = x.ToString();
textBox1.Text = x.ToString();
progressBar1.Va lue = x;
progressBar1.Pe rformStep();
Thread.Sleep(10 );
}
}
private void btnStart_Click( object sender, EventArgs e)
{
toolStripStatus Label1.Text = "Starting!! !";
UpdateProgressB ar();
}
private void btnClose_Click( object sender, EventArgs e)
{
progressBar1.Di spose();
Application.Exi t();
}
}
}
Comment