public void SetLableText(Label lbPassLabel, string sPassText)
 {
     if (lbPassLabel.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLableText);
         this.Invoke(d, new object[] { lbPassLabel, sPassText });
     }
     else
     {
         lbPassLabel.Text = sPassText;
     }
 }
Exemple #2
0
 private void SetLabelText(Label label, string text)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback de = new SetLabelTextCallback(SetLabelText);
         this.Invoke(de, new object[] { label, text });
     }
     else
     {
         label.Text = text;
     }
 }
 private void SetLabelText(Label b, string value)
 {
     if (b.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         b.BeginInvoke(d, new object[] { b, value });
     }
     else
     {
         b.Text = value;
     }
 }
Exemple #4
0
 private void SetLabel(Label lbl, string message)
 {
     if (lbl.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabel);
         this.Invoke(d, new object[] { lbl, message });
     }
     else
     {
         lbl.Text = message;
         Application.DoEvents();
     }
 }
Exemple #5
0
 internal void SetLabelText(Label label, String text)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         this.Invoke(d, new object[] { label, text });
     }
     else
     {
         label.Text = text;
         this.Invalidate();
     }
 }
Exemple #6
0
        public void UpdateTransactionId(Label label_id, string id)
        {
            //label_id.Text = id;

            if (label_id.InvokeRequired)
            {
                SetLabelTextCallback d = new SetLabelTextCallback(UpdateTransactionId);
                this.Invoke(d, new object[] { label_id, id });
            }
            else
            {
                label_id.Text = id;
            }
        }
Exemple #7
0
 public void SetLabelText(String number)
 {
     if (this.labNumber.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         Invoke(d, new object[] { number });
     }
     else
     {
         butPositive.Enabled = true;
         butNegative.Enabled = true;
         labNumber.Text      = number;
     }
 }
Exemple #8
0
 private void SetLabelText(Label lbl, 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 (lbl.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         this.Invoke(d, new object[] { lbl, text });
     }
     else
     {
         lbl.Text = text;
     }
 }
Exemple #9
0
        private void SetLabelText(string id, int currentnumber, int totalNumber)
        {
            if (lbInfo.InvokeRequired)
            {
                if (_slCall == null)
                {
                    _slCall = SetLabelText;
                }

                Invoke(_slCall, id, currentnumber, totalNumber);
            }
            else
            {
                lbInfo.Text = $@"Aktuelle Beleg (ID): {id} ({currentnumber} von {totalNumber})";
            }
        }
Exemple #10
0
 public void SetLabelText(System.IO.UnmanagedMemoryStream sound)
 {
     if (this.labNumber.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         Invoke(d, new object[] { sound });
     }
     else
     {
         butPositive.Enabled = true;
         butNegative.Enabled = true;
         SoundPlayer player = new SoundPlayer();
         sound.Position = 0;
         player.Stream  = null;
         player.Stream  = sound;
         player.Play();
     }
 }
 public void setLabelText(Label rtb, string value)
 {
     if (InvokeRequired)
     {
         try
         {
             SetLabelTextCallback d = new SetLabelTextCallback(setLabelText);
             this.Invoke(d, new object[] { rtb, value });
             //this.Invoke(new Action<string>(AppendTextBox), new object[] { value });
         }
         catch
         {
         }
         return;
     }
     else
     {
         lbThreads.Text = value;
     }
 }
Exemple #12
0
 private void SetLabelText(Control control, 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 (control.InvokeRequired)   //如果调用控件的线程和创建创建控件的线程不是同一个则为True
     {
         while (!control.IsHandleCreated)
         {
             //解决窗体关闭时出现“访问已释放句柄“的异常
             if (control.Disposing || control.IsDisposed)
             {
                 return;
             }
         }
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         control.Invoke(d, new object[] { control, text });
     }
     else
     {
         control.Text = text;
     }
 }
Exemple #13
0
 private void SetLabelText(string Message, Label label)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         this.Invoke(d, new object[] { Message, label });
     }
     else
     {
         label.Text = Message;
     }
 }
 private void SetLabelText(Label label, 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 (label.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         label.BeginInvoke(d, new object[] { label, text });
     }
     else
     {
         label.Text = text;
     }
 }
Exemple #15
0
 internal void SetLabelText(Label label, String text)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         this.Invoke(d, new object[] { label, text });
     }
     else
     {
         label.Text = text;
         this.Invalidate();
     }
 }
Exemple #16
0
 protected void SetLabelText(Label b, string value)
 {
     if (b.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
         b.BeginInvoke(d, new object[] { b, value });
     }
     else
     {
         b.Text = value;
     }
 }
Exemple #17
0
        public void SetLabelText(string text, string dest)
        {
            switch (dest)
            {
            case "stepNumLbl":
                if (this.stepNumLbl.InvokeRequired)
                {
                    SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
                    this.Invoke(d, new object[] { text, dest });
                }
                else
                {
                    this.stepNumLbl.Text = "StepNum: " + text;
                }
                break;

            case "instrTextLbl":
                if (this.instrTextLbl.InvokeRequired)
                {
                    SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
                    this.Invoke(d, new object[] { text, dest });
                }
                else
                {
                    this.instrTextLbl.Text = "Instruction: " + text;
                }
                break;

            case "disassemblyLbl":
                if (this.disassemblyLbl.InvokeRequired)
                {
                    SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
                    this.Invoke(d, new object[] { text, dest });
                }
                else
                {
                    this.disassemblyLbl.Text = "Disassembly: " + text;
                }
                break;

            case "nextInstrLbl":
                if (this.nextInstrLbl.InvokeRequired)
                {
                    SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
                    this.Invoke(d, new object[] { text, dest });
                }
                else
                {
                    this.nextInstrLbl.Text = "Next instruction: " + text;
                }
                break;

            case "nextDisasmLbl":
                if (this.nextDisasmLbl.InvokeRequired)
                {
                    SetLabelTextCallback d = new SetLabelTextCallback(SetLabelText);
                    this.Invoke(d, new object[] { text, dest });
                }
                else
                {
                    this.nextDisasmLbl.Text = "Disassembly: " + text;
                }
                break;
            }
        }
Exemple #18
0
 private void SetLabelText(Label label, String text)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback callback = new SetLabelTextCallback(SetLabelText);
         this.Invoke(callback, new object[] { label, text });
     }
     else
     {
         label.Text = text;
         label.Visible = true;
         label.TextAlign = ContentAlignment.MiddleCenter;
     }
 }
 /**
  * Update label for this download.
  */
 private void _setLabelText(Label label, String text)
 {
     if (label.InvokeRequired)
     {
         SetLabelTextCallback d = new SetLabelTextCallback(_setLabelText);
         label.Invoke(d, new object[] { label, text });
     }
     else
     {
         label.Text = text;
     }
 }