1.
Private void form1_load (Object sender, system. eventargs E)
For (double D = 0.01; D <1; D + = 0.02)
{
System. Threading. thread. Sleep (1 );
Application. doevents ();
This. Opacity = D;
This. Refresh ();
}
2.
Private void timerjavastick (Object sender, system. eventargs E)
{
This. Opacity = winshow;
Winshow ++ = 0.1;
If (winshow> = 1)
{
Timer1.dispose ();
}
}
3.
Use a loop or timer,
Frmform myform = new frmform ()
Frmform. Opacity = 0;
Frmform. Show ();
For (INT I = 0; I <100; I ++)
{
Application. doevents ()
Frmform. Opacity = I/100;
}
4.
# Region ******** form fade-in effect function ********
Private double winshow = 0; // variable used for window fade-in effect
Private void formshow (system. Windows. Forms. Form curfrm)
{
Curfrm. Opacity = winshow;
Winshow ++ = 0.01;
If (winshow = 1)
{
Curfrm. timershow. Stop ();
}
}
# Endregion
# Region ******** example of function calling for form fade-in effect ********
// Implement the fade-in effect of the window
Private void timershow_tick (Object sender, system. eventargs E)
{
// Timershow, which is the name of the timer control. Set timershow. interval to 100.
Formshow (this );
}
# Endregion
Http://publishblog.blogchina.com/blog/tb. B? Diaryid = 5564742