use AnimateWindow to create a form namespace for the fade effect:usingSystem.Runtime.InteropServices; API functions: [DllImport ("User32")]Private Static extern BOOLAnimateWindow (IntPtr whnd,intDwtime,intdwflag);//the values of the Dwflag are as follows Public ConstInt32 aw_hor_positive =0x00000001; //show from left to right Public ConstInt32 aw_hor_negative =0x00000002; //display from right to left Public ConstInt32 aw_ver_positive =0x00000004; //show from top to bottom Public ConstInt32 aw_ver_negative =0x00000008; //show from bottom to top Public ConstInt32 Aw_center =0x00000010; //If the Aw_hide flag is used, the window is overlapped inward, that is , the window is shrunk, otherwise the window is expanded outward, that is, the window is expanded Public ConstInt32 aw_hide =0x00010000; //Hide window, default display window Public ConstInt32 aw_activate =0x00020000; //activates the window. This flag cannot be used after using the AW_HIDE flag Public ConstInt32 aw_slide =0x00040000; //use the sliding type. The default is the scrolling animation type. This flag is ignored when using the Aw_center flag Public ConstInt32 Aw_blend =0x00080000; //transparency from high to low//add code in Form_Load to implement the fade-in formAnimateWindow ( This. Handle, the, Aw_blend |aw_activate);//Multiple Dwflag between | Separated//add code in form_formclosing to fade out a formAnimateWindow ( This. Handle, the, Aw_hor_negative |aw_hide);//you must have aw_hide to see the fade out of the form