The Motivation

I required a fade/slide effect to replace a previous thread based approach that was using deprecated methods.

When consulting the oracle (Google), I was able to find more than a few articles that use opacity or utility type implementation of the AnimateWindow function, but I was looking for a solution to hide the functionality and keep things as simple as possible, so I created FadeForm.

The Objective

Write a class that implements/wraps the AnimateWindow function which can easily be added to existing code.

The Code

The FadePage Object

Create a new class that derives from System.Windows.Forms.Form which will allow us to extend the behavior of a standard form with the AnimateWindow method.

publicabstractclass FadeForm : Form
{}

Next, create a member variable that will determine if we fade or slide, and a few constructors to assign the variable, with the default being the slide effect.

Comments and Discussions

SlideControl is a .NET container control that manages presentation slides and offers a pleasing slide-effect when switching between slides. SlideControl has a built-in backtracking-stack that remembers slides visited and unrolls these actions on demand.