Pages

Friday, August 28, 2009

Close a Form Slowly C# by Praveen P.R

// Code in C#
//Close a form Slowly C#
  public static void closeWindowSlowly(Form currentForm)
  {
  lock (currentForm)
  {
  for (double x = 1.0d; x > 0d; x = x - 0.1d)
  {
  System.Threading.Thread.Sleep(50);
  currentForm.Opacity = x;
  currentForm.Refresh();
  }
  }
  }

No comments: