一个非常拽的效果


把下面的代码放到你的应用程序中,运行一下就知道效果了.

 [System.Runtime.InteropServices.DllImport("user32")]
   
private static extern bool AnimateWindow(IntPtr hwnd,int dwTime, int dwFlags);
   
const int AW_HOR_POSITIVE = 0x0001;
   
const int AW_HOR_NEGATIVE = 0x0002;
   
const int AW_VER_POSITIVE = 0x0004;
   
const int AW_VER_NEGATIVE = 0x0008;
   
const int AW_CENTER = 0x0010;
   
const int AW_HIDE = 0x10000;
   
const int AW_ACTIVATE = 0x20000;
   
const int AW_SLIDE = 0x40000;

   
const int AW_BLEND = 0x80000;  

   
private void Form1_Load(object sender, System.EventArgs e)
   
{
    AnimateWindow(
this.Handle,1000, AW_CENTER | AW_ACTIVATE);
  
   }


 
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
   
{
             AnimateWindow(
this.Handle, 1000, AW_SLIDE | AW_HIDE | AW_VER_NEGATIVE);
 }

posted @ 2008-03-30 17:03  侯垒  阅读(446)  评论(4)    收藏  举报
Powered by: holly