Ejemplo n.º 1
0
        string SetStatusBarText(StatusBar statusbar,
            string strText)
        {
            string strOldText = statusbar.Text;

            statusbar.Text = strText;
            statusbar.Update();

            return strOldText;
        }
Ejemplo n.º 2
0
        // 线程安全版本
        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;
            }
        }