private void button2_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string name = openFileDialog1.FileName; FileInfo src = new FileInfo(openFileDialog1.FileName); Thread t = new Thread(() => startsending(src)); // t.IsBackground = true; t.Start(); // sndfle.RunWorkerAsync(index + ":"+openFileDialog1.FileName); } } private void startsending(FileInfo src) { fileoperatrionform fm = new fileoperatrionform(cp, src);//this is constructor of fileoperationform and here cp is user defined class; }
Invoke
BeginInvoke
System.Windows.Threading.Dispatcher
System.Windows.Forms.Control
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)