private void button6_Click(object sender, EventArgs e) { Thread thread = new Thread(() => { Tools.CoctaiSort(int.Parse(DeleyTime.Text)); MessageBox.Show("Done"); }); thread.Start(); }