/// ///////////////////////////////////////////////////////////////// public static void StartThreadWithProgress(string strTitre, ThreadStart fonctionDemarrage, bool bWaitEnd) { if (m_form == null) { m_form = new CFormProgressTimos(); } m_form.ResetSegmentsProgression(); m_form.TopMost = true; m_form.BringToFront(); m_form.m_labelInfo.Text = strTitre; m_form.Show(); m_form.TopMost = false; m_form.Refresh(); if (bWaitEnd) { try { Thread th = new Thread(fonctionDemarrage); th.SetApartmentState(ApartmentState.STA); th.Start(); th.Join(); } catch {} try { m_form.Hide(); } catch { } } else { fonctionDemarrage.BeginInvoke(new AsyncCallback(m_form.OnEndProcess), null); } }