I have a problem with WinForm in Visual Studio 2010 with a progress bar. I am making two progress bars to read files from a folder, one for the amount of files and the other for the amount of lines. The progress bars get instantiated and the line progress bar will display with the standard green progress bar, but the file progress bar will not display anything till after an update or two.
I have tried this.progressbar1.Show() and this.progressbar1.Visible = true and they do not work in this case.
Any help is appreciated :)
this.progressBar1.Location = new System.Drawing.Point(15, 25);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(373, 23);
this.progressBar1.TabIndex = 0;
this.progressBar1.Visible = true;
here is the methods in the program:
public ProgressBar()
{
InitializeComponent();
}
public void SetTitle(string title)
{
this.Text = title;
}
public void SetMessage(string txt)
{
label1.Text = txt;
label1.Refresh();
}
public void SetFile(string txt)
{
label2.Text = txt;
label2.Refresh();
}
private void timer1_Tick1(object sender, EventArgs e)
{
this.Refresh();
}
public void SetValuesBar1(int i)
{
progressBar1.Maximum = i;
progressBar1.Minimum = 0;
progressBar1.Value = 0;
}
public void SetValuesBar2(int i)
{
progressBar2.Maximum = i;
progressBar2.Minimum = 0;
progressBar2.Value = 0;
}