private void button22_Click(object sender, EventArgs e) { Thread thread = new Thread(() => { Tools.BeadSort(); MessageBox.Show("Done"); }); thread.Start(); }