private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Master.Stop(); doLoop = false; KeyLoop.Join(); }