string SetStatusBarText(StatusBar statusbar, string strText) { string strOldText = statusbar.Text; statusbar.Text = strText; statusbar.Update(); return strOldText; }
// 线程安全版本 string Safe_SetStatusBarText(StatusBar statusbar, string strText) { if (statusbar.Parent != null && statusbar.Parent.InvokeRequired) { Delegate_SetStatusBarText d = new Delegate_SetStatusBarText(SetStatusBarText); return (string)statusbar.Parent.Invoke(d, new object[] { statusbar, strText }); } else { string strOldText = statusbar.Text; statusbar.Text = strText; statusbar.Update(); return strOldText; } }