Form2,模態窗體
using System;
using System.Windows.Forms;
namespace WindowsApplication39
...{
public partial class Form2 : Form
...{
public Form2()
...{
InitializeComponent();
}
public delegate void dSetProgress(int total, int current);
public void SetProgress(int total, int current)
...{
if (this.InvokeRequired)
...{
try
...{
this.Invoke(new dSetProgress(this.SetProgress), new object[] ...{ total, current });
}
catch ...{ }
}
else
...{
this.progressBar1.Maximum = total;
this.progressBar1.Value = current;
}
}
private void button1_Click(object sender, EventArgs e)
...{
this.DialogResult = DialogResult.Cancel;
}
}
}