我有一個窗體應用程序使用一個類(它的名字是Parser
) 這個窗體有一個按鈕,當我點擊窗體窗體應用程序按鈕時,它調用一個解析器類的方法。添加進度條
這種方法只是簡單的閱讀文本文件的行,寫每一行分開的文件...
我想一個進度條,以顯示進度添加到窗體(這是一個非常大的文件)
任何想法該怎麼做?我在Parse class 2屬性中有一個用於文件中的行數,第二個是已經檢查了多少行。
這裏是我的button2_Click
功能
private void button2_Click(object sender, EventArgs e)
{
if (this.textBox1 != null & this.textBox2 != null)
{
inst.init(this.textBox1.Text, this.textBox2.Text);
//this.progressBar1.Show();
inst.ParseTheFile();
System.Windows.Forms.MessageBox.Show("Parsing finish successfully");
}
}
你應該命名你的控件。 – SLaks