Läßt eine Form langsam verschwinden wenn sie geschlossen wird.
/// <summary>
/// Fading out a form. It's just a nice effect. Call in the OnFormClosing event.
/// </summary>
/// <param name="FormToFadeOut">The form to close.</param>
public static void FadeOutForm(Form FormToFadeOut)
{
float Step = (float)(100f / 20);
float Opacity = 100f;
for (byte b = 0; b < 10; b++)
{
FormToFadeOut.Opacity = Opacity / 100;
FormToFadeOut.Refresh();
Opacity -= Step;
}
}
Kommentare zum Snippet