1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| public partial class Form1 : Form
{
private Thread th;
private PPE alfa;
public Form1()
{
InitializeComponent();
button1.Click += new EventHandler(btnLancer_Click);
}
private void btnLancer_Click(object sender, EventArgs e)
{
this.alfa = new PPE();
this.th = new Thread(new ThreadStart(Progres));
this.th.Start();
}
public void Progres()
{
do
{
this.label2.Text = this.alfa.result.ToString();
this.label4.Text = this.alfa.lastNbr.ToString();
this.label5.Text = this.alfa.result.ToString();
progressBar1.Value = this.alfa.alfa.nbr.Count;
} while (progressBar1.Value < this.alfa.alfa.nbrGenerated);
}
} |