private void BUT_xplane_Click(object sender, EventArgs e) { if (xp == null) { xp = new HIL.XPlane(); xp.SetupSockets(49005, 49000, "127.0.0.1"); } System.Threading.ThreadPool.QueueUserWorkItem(runxplanemove); //xp.Shutdown(); }