Exemple #1
0
 private void SetVis(bool vis, Control label)
 {
     if (label.InvokeRequired)
     {
         SetVisCallback d = new SetVisCallback(SetVis);
         label.Invoke(d, new object[] { vis, label });
     }
     else
     {
         label.Visible = vis;
     }
 }
Exemple #2
0
 private void SetLabel()
 {
     // 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 (ThinkLabel.InvokeRequired)
     {
         SetVisCallback d = new SetVisCallback(SetLabel);
         ThinkLabel.Invoke(d, new object[] {});
     }
     else
     {
         ThinkLabel.Visible = false;
     }
 }
Exemple #3
0
 private void SetControlVisible(bool win, Control c)
 {
     // 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 (winnerLabel.InvokeRequired)
     {
         SetVisCallback d = new SetVisCallback(SetControlVisible);
         winnerLabel.Invoke(d, new object[] { win, c });
     }
     else
     {
         c.Visible = win;
     }
 }