private void Form1_Load(object sender, EventArgs e) { vms = new VM(this); UI_VM_CONTAINER.Controls.Clear(); th = new Thread(new ThreadStart(vms.getRemoteVM)); th.Start(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { timer1.Enabled = false; if (th.IsAlive) th.Abort(); th = null; vms = null; }