ARTICLE

Animating Window Form (Fade Effect)

Posted by Kirtan Patel Articles | Windows Forms C# March 04, 2010
Here in this article we are going to make the fade effect animation in windows form.
Reader Level:
 

Introduction

To make application look better we have use some eye candy to it. Like in some crack program you have seen when they start they are visible smoothly. Here we are going to make the same fade effect animation using very simple code.

Form while initializing ...                                               form after fade effect..

1.gif

Technologies:

Windows Form .net 2.0/3.5

Language:

C# 

Prerequisite

1.NET Framework 2.0/3.5
2. Visual Studio 2005/2008

Implementation

It is very simple to use this code just 2-4 line of code

1.timer 
2.form

-> start with new windows form project 

-> drag drop timer component from the toolbar on to form say timer1

Now to display fade effect we should first make the form 100% transparent then after the form will be displayed smoothly.

To do so in form' load event write code like below

private void Form1_Load(object sender, EventArgs e)
{
    // Set Form's Transperancy 100 %
    this.Opacity = 0;

    // Start the Timer To Animate Form
    timer1.Enabled = true;
}

And in timer's tick Event Write code like below.

private void timer1_Tick(object sender, EventArgs e)
{
    // Make Form Visible a Bit more on Every timer Tick
    this.Opacity += 0.07;
}

Run Project you are done!!

Login to add your contents and source code to this article
post comment
     

very good

Posted by Nilesh tarwatkar Jan 26, 2011

when i want to open the project , a error has been displayed that " unable to read the project file, the imported project was not found . confirm the path in the <import> declaration is correct.and that the file exist on the disk." and i can't open the project.

Posted by koushik bug Dec 19, 2010

thanks :)

Posted by Kirtan Patel Oct 18, 2010

Very nice article i like it so much
thanks

Posted by abhi abhi Oct 11, 2010
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts