public partial class waitingProcessbar : Form { public waitingProcessbar() { InitializeComponent(); } /// /// 设定百分比 /// private int percent; /// /// 字符显示百分比 /// private string labelShow; public int Percent { get { return percent; } set { this.percent = value; if (this.percent > 100) { this.Close(); } this.progressBar1.Value = percent; } } public string LabelShow { get { return this.labelShow; } set { this.labelShow = value; this.label1.Text = labelShow.ToString(); } } public void ShowProcess(int num,string str) { this.Show(); this.Percent = num; this.LabelShow = str; progressBar1.Invalidate(); label1.Refresh(); } }
|