示例#1
0
 public void SetHeight(int data)
 {
     if (this.InvokeRequired)
     {
         SetHeightCallback d = new SetHeightCallback(SetHeight);
         this.Invoke(d, new object[] { data });
     }
     else
     {
         this.Height = data;
     }
 }
示例#2
0
 private void SetFormHeightValue(int value)
 {
     // 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.InvokeRequired)
     {
         SetHeightCallback d = new SetHeightCallback(SetFormHeightValue);
         try
         {
             this.Invoke(d, new object[] { value });
         }
         catch (Exception)
         {
         }
     }
     else
     {
         this.Height = value;
     }
 }