Example #1
0
 private void setStatusLabel(string text)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.statusBar.InvokeRequired)
     {
         SetStatusLabelCallback d = new SetStatusLabelCallback(setStatusLabel);
         if (this.statusBar != null && !this.statusBar.IsDisposed)
         {
             this.statusBar.Invoke(d, new object[] { text });
         }
     }
     else
     {
         if (this.statusBar != null && !this.statusBar.IsDisposed)
         {
             this.statusLabel.Text = text;
         }
         Thread.Sleep(100);
         if (this.statusBar != null && !this.statusBar.IsDisposed)
         {
             this.statusBar.Refresh();
         }
     }
 }
 public Form1()
 {
     InitializeComponent();
     this.form = this;
     SetStatusLabelDelegate = new SetStatusLabelCallback(SetStatusLabel);
     SetButtonDelegate      = new SetButtonCallback(SetButton);
     OpenNextFormDelegate   = new OpenNextFormCallback(OpenNextForm);
 }
 private void SetStatusLabel(string text)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (lblStatus.InvokeRequired)
     {
         SetStatusLabelCallback d = new SetStatusLabelCallback(SetStatusLabel);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         this.lblStatus.Text = text;
     }
 }
Example #4
0
 private void SetStatusLabel(string status)
 {
     if (toolStrip1.InvokeRequired)
     {
         SetStatusLabelCallback d = new SetStatusLabelCallback(SetStatusLabel);
         Invoke(d, new object[] { status });
     }
     else
     {
         if (status.Length > 0)
         {
             toolStripStatusLabel1.Text    = status;
             toolStripStatusLabel1.Visible = true;
         }
         else
         {
             toolStripStatusLabel1.Visible = false;
         }
         toolStrip1.Refresh();
     }
 }
Example #5
0
 public void SetStatusLabel( string status )
 {
     if( toolStrip1.InvokeRequired )
     {
         SetStatusLabelCallback d = new SetStatusLabelCallback( SetStatusLabel );
         Invoke( d, new object[] { status } );
     } else
     {
         if( status.Length > 0 )
         {
             toolStripStatusLabel1.Text = status;
             toolStripStatusLabel1.Visible = true;
         } else
             toolStripStatusLabel1.Visible = false;
         toolStrip1.Refresh();
     }
 }
Example #6
0
        private void SetStatusLabel(Label label, string text, Color color)
        {
            if (label.InvokeRequired)
            {
                SetStatusLabelCallback ssc = new SetStatusLabelCallback(SetStatusLabel);

                this.Invoke(ssc, label, text, color);
            }
            else
            {
                label.Text = text;
                label.ForeColor = color;
            }
        }
 public void SetStatusLabel(string msg)
 {
     if (this.statusLabel.InvokeRequired)
     {
         SetStatusLabelCallback cb = new SetStatusLabelCallback(SetStatusLabel);
         this.Invoke(cb, new Object[] { msg });
     }
     else
     {
         statusLabel.Text = msg;
     }
 }