Animate Windows Form using C#

No.of Views2983
Bookmarked1 times
Downloads 
Votes0
By  kirtan007   On  16 Feb 2010 00:02:48
Tag : CSharp , Windows Forms
Animate Windows Form using C#
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

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 ..
BeforeLoading AfterLoading

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

-> Set Timer's Interval Property to 2 Milisecond

Now to Display Fade Effect We Should First make the Form 100% Transperent Then After The Form Will be Displayed Smoothly.
to Do So In Form' Load Event

Write Code like Below


{codecitation class="brush: csharp; gutter: true;" width="650px"}

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;
}


Now in Timer's Tick Event Write code ad Below

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


{/codecitation}

Run Project You are Done


How incorporate/use in user project

Dragdrop Require components on Form . Set Properties and Write / Copy Source code Above and You are Done!!


Thank You

About the Author


Kirtan Patel
- Bachelor of Computer Application .
- File Handling with C#
- Registry Programming With C#.
- Knowledge of Virus Programming .
- Working With third party controls like Telerik and Component Factory .
- P/invoke Win32 API.
- SQL Server Database Applications
- Client/Server Database Programming

Expertise in : C# , Asp.net ,Vb.net , SQL Server , Designing Elegant look Web interface

Familiar With : C/C++ , Core Java , Java Script , Dream weaver templates , fire Works , Photo shop Graphics ,PHP

Databases: Microsoft SQL Server 2005 , Microsoft Access and Some MySQL

Occupation: Student


 
Sign Up to vote for this article
 
About Author
 
kirtan007
Occupation-
Company-
Member Type-Senior
Location-Not Provided
Joined date-02 Jul 2009
Home Page-http://kirtan.uni.cc
Blog Page-
He completed his Bachelor of Computer Application from Gujarat University 2009 .He is doing Master of Computer Application from Gujarat Technological University right now .. His area of Interests are Web Hacking , C# .net Windows form ,asp.net , WPF ,Silverlight ,SQL Server and Some PHP.
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top