/// <summary> /// 释放进度条 /// </summary> public static void Free() { if (timerWait != null) { timerWait.Close(); } inCycle = false; Thread.Sleep(200); Application.DoEvents(); if (pThread != null) { try { pThread.Abort(); } catch { } } pThread = null; if (_pBar != null) { _pBar = null; } Form fm = Application.OpenForms["PBarUtil"]; if (fm != null) { fm = null; } }
private static PBarUtil pBarUtil() { if ((_pBar == null) || (_pBar.IsDisposed)) { _pBar = new PBarUtil(); } return(_pBar); }