7
Mar/080
Mar/080
Windows Forms Fade in and Fade out Extension Methods
Following is some code I had to write the other day to fade a Windows Forms Form in and out of view. I have implemented the methods FadeIn and FadeOut as extension methods on the System.Windows.Forms.Form class. To use this, simply import the namespace that you copy the class FormExtensions into into the code file of your form. And then call the methods FadeIn and FadeOut as required. Happy Fading
using System.Windows.Forms;
///
/// Contains methods to extend System.Windows.Forms.Form to have the ability to fade in and fade out
///
public static class FormExtensions
{
///
/// Fade the form in
///
///
public static void FadeIn(this Form form, int seconds)
{