コード例 #1
0
ファイル: Form1.cs プロジェクト: yuanzj/ReserchDownload
        private void UpdateStatusBar(int no, string msg, string version)
        {
            if (this.statusStrip_settings.InvokeRequired)//如果调用控件的线程和创建创建控件的线程不是同一个则为True
            {
                while (!this.statusStrip_settings.IsHandleCreated)
                {
                    //解决窗体关闭时出现“访问已释放句柄“的异常
                    if (this.statusStrip_settings.Disposing || this.statusStrip_settings.IsDisposed)
                    {
                        return;
                    }
                }
                UpdateStatusBarCallback d = new UpdateStatusBarCallback(UpdateStatusBar);
                this.statusStrip_settings.Invoke(d, new object[] { no, msg, version });
            }
            else
            {
                switch (no)
                {
                case 0:
                    this.toolStripStatusLabel_Uart.Text = msg;
                    break;

                case 1:
                    this.toolStripStatusLabel_mode.Text = version;
                    break;
                }
            }
        }
        public void UpdateStatusBar(string message)
        {
            if (this.InvokeRequired)
            {
                UpdateStatusBarCallback statCB = new UpdateStatusBarCallback(UpdateStatusBar);
                this.Invoke(statCB, new object[] { message });
            }
            else
            {
                // Update the status bar.
                toolStripStatusLabel1.Text = message;

                // Also write this message to the console.
                Console.WriteLine(message);
            }
        }
コード例 #3
0
        public void UpdateStatusBar(string message)
        {
            if (this.InvokeRequired)
            {
                UpdateStatusBarCallback statCB = new UpdateStatusBarCallback(UpdateStatusBar);
                this.Invoke(statCB, new object[] { message });
            }
            else
            {
                // Update the status bar.
                toolStripStatusLabel1.Text = message;

                // Also write this message to the console.
                Console.WriteLine(message);
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: korion2525/stromohab-2008
        /// <summary>
        /// Thread safe update of the status bar with supplied string
        /// </summary>
        /// <param name="text"></param>
        private void UpdateStatusBar(string text)
        {
            if (this.statusBar1.InvokeRequired)
            {
                UpdateStatusBarCallback d = new UpdateStatusBarCallback(UpdateStatusBar);
                this.Invoke(d, new object[] { text });
            }
            else
            {
                //put required actions here
                this.statusBar1.Text = text;

                if (text.Equals("Cameras Started"))
                {
                    this.timerPollCameraInterface.Enabled = true;
                }
            }
        }
コード例 #5
0
        /// <summary>
        /// Thread safe update of the status bar with supplied string
        /// </summary>
        /// <param name="text"></param>
        private void UpdateStatusBar(string text)
        {
            if (this.statusBar1.InvokeRequired)
            {
                UpdateStatusBarCallback d = new UpdateStatusBarCallback(UpdateStatusBar);
                this.Invoke(d, new object[] { text });
            }
            else
            {
                //put required actions here
                this.statusBar1.Text = text;
                
                if (text.Equals("Cameras Started"))
                {
                    this.timerPollCameraInterface.Enabled = true;
                }

            }
        }