private void btnRun_Click(object sender, EventArgs e) { XAPRunnerThreadClass runThreadClass = new XAPRunnerThreadClass(this, targetXAP); Thread runnerThread = new Thread(new ThreadStart(runThreadClass.Run)); runnerThread.Start(); //btnStop.Enabled = true; }