private void AttachmentsDocumentGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { string temppath = ""; { T = new System.Threading.Thread(delegate() { temppath = ClientPayments.SaveFile(AttachmentsDocumentGrid.SelectedRows[0].Cells["FileName"].Value.ToString()); }); T.Start(); while (T.IsAlive) { T.Join(50); Application.DoEvents(); if (bStopTransfer) { FM.bStopTransfer = true; bStopTransfer = false; timer1.Enabled = false; return; } } if (!bStopTransfer && temppath != null) { System.Diagnostics.Process.Start(temppath); } } }