Ejemplo n.º 1
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     if (base.Visible)
     {
         if (this.Special && !base.DesignMode)
         {
             CCWin.Win32.NativeMethods.AnimateWindow(base.Handle, 150, 0xa0000);
             base.Opacity = this.SkinOpacity;
         }
         if ((!base.DesignMode && (this.skin == null)) && this.Shadow)
         {
             this.skin = new CCSkinForm(this);
             this.skin.Show(this);
         }
         base.OnVisibleChanged(e);
     }
     else
     {
         base.OnVisibleChanged(e);
         if (this.Special)
         {
             base.Opacity = 1.0;
             CCWin.Win32.NativeMethods.AnimateWindow(base.Handle, 150, 0x90000);
         }
     }
 }
Ejemplo n.º 2
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     if (Visible)
     {
         //启用窗口淡入淡出
         if (Special && !DesignMode)
         {
             int House = OneVisibles && Shadow ? 300 : 150;
             //淡入特效
             NativeMethods.AnimateWindow(this.Handle, House, AW.AW_BLEND | AW.AW_ACTIVATE);
             Opacity = SkinOpacity;
             Update();
         }
         //判断不是在设计器中
         if (!DesignMode && skin == null && Shadow)
         {
             skin = new CCSkinForm(this);
             skin.Show(this);
         }
         OneVisibles = false;
         base.OnVisibleChanged(e);
     }
     else
     {
         base.OnVisibleChanged(e);
         //启用窗口淡入淡出
         if (Special && !DesignMode)
         {
             Opacity = 1;
             //实现窗体的淡出
             NativeMethods.AnimateWindow(this.Handle, 150, AW.AW_BLEND | AW.AW_HIDE);
             Update();
         }
     }
 }