private void timer1_Tick(object sender, EventArgs e) { Test t =(Test)tests[listBox_Tests.SelectedIndex]; int power = t.update(counter); if(power>-1) { Com.Write("PW " + power); } counter++; if (counter > t.powerStack.Length*t.timeCounter) { Form testdialog = new TestDialog(this, clientApplicatie); testdialog.BringToFront(); testdialog.Show(); testdialog.BringToFront(); timer1.Stop(); } }