【发布时间】:2011-09-25 14:42:17
【问题描述】:
我有一个使用一个类的 Windows 窗体应用程序(它的名称是 Parser)
此表单有一个按钮,当我单击 Windows 表单应用程序按钮时,它会调用解析器类方法之一。
此方法只是逐行读取文本文件并将每一行写入单独的文件...
我想在表单中添加一个进度条以显示进度(这是一个非常大的文件)
知道怎么做吗?我在 Parse 类 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");
}
}
【问题讨论】:
-
你应该为你的控件命名。
标签: c# progress-bar