//***************************************************************************
 // Static Methods
 // 
 /// <summary>
 /// Tells the specified control to invalidate its client area and immediately redraw itself.
 /// </summary>
 /// <param name="ctrl"></param>
 public static void RefreshControl(Control ctrl)
 {
     if (ctrl.InvokeRequired)
     {
         RefreshControlDelegate del = new RefreshControlDelegate(CrossThreadUI.RefreshControl);
         if (CrossThreadUI.ExecSync)
             ctrl.Invoke(del);
         else
             ctrl.BeginInvoke(del);
     }
     else
         ctrl.Invalidate();
 }
Example #2
0
 //***************************************************************************
 // Static Methods
 //
 /// <summary>
 /// Tells the specified control to invalidate its client area and immediately redraw itself.
 /// </summary>
 /// <param name="ctrl"></param>
 public static void RefreshControl(Control ctrl)
 {
     if (ctrl.InvokeRequired)
     {
         RefreshControlDelegate del = new RefreshControlDelegate(CrossThreadUI.RefreshControl);
         if (CrossThreadUI.ExecSync)
         {
             ctrl.Invoke(del);
         }
         else
         {
             ctrl.BeginInvoke(del);
         }
     }
     else
     {
         ctrl.Invalidate();
     }
 }