0

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;
}
Idle_Mind
  • 38,363
  • 3
  • 29
  • 40
  • You need to run your process on a separate thread.. Please show your code that demonstrates the problem as well as what you have tried/researched – Sayse Jul 27 '15 at 13:34
  • Thanks :) I will remember to put the code in, kind of slipped my mind there, it is my first question. I will try that and see if it works – notbignick1 Jul 27 '15 at 13:37
  • See this : http://stackoverflow.com/questions/12126889/how-to-use-winforms-progress-bar – PaulF Jul 27 '15 at 13:44

0 Answers0