Add timer controller to Form that you are selected.
Then add following code to timer control
private bool setClose = false; private void timer1_Tick(object sender, EventArgs e) { this.Opacity -= 0.05; if(this.Opacity<0.05) { setClose = true; this.Close(); } }
Finally add the following code to FormClosing event
private void myForm_FormClosing(object sender,FormClosingEventArgs e) { if(!setClose) { e.Cancel=true; this.timer1.Enabled=true; } }
Finally you have done it, Experience the fadeout effect in windows forms
Get code from here http://www.ziddu.com/download/12396154/urbuddyApp.7z.html
0 comments:
Post a Comment