zoukankan      html  css  js  c++  java
  • 窗体变换效果

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    
    namespace 窗体翻转
    {
        public partial class Form1 : Form
        {
            //导入user32.dll
            [System.Runtime.InteropServices.DllImport("user32.dll")]
            //声明API函数
            private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
            /*
             * hwnd 界面上控件的句柄
             * dwTime 窗体特效持续的时间(毫秒)
             * dwFlags 窗体特效的值
             */
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_MouseClick(object sender, MouseEventArgs e)
            {
                AnimateWindow(this.Handle, 1000, 0x10010);//居中逐渐隐藏
                AnimateWindow(this.Handle, 1000, 0x20010);//居中逐渐显示
    
                AnimateWindow(this.Handle, 1000, 0x90000); // 淡入淡出效果。
                AnimateWindow(this.Handle, 1000, 0xA0000); // 淡入淡出效果。
    
                AnimateWindow(this.Handle, 1000, 0x50008); // 自下而上。
                AnimateWindow(this.Handle, 1000, 0x60004); // 自上向下。
    
                AnimateWindow(this.Handle, 1000, 0x10008); // 自下而上。
                AnimateWindow(this.Handle, 1000, 0x20004); // 自上向下。
    
            }
        }
    }
    世上无难事,只要肯登攀。
  • 相关阅读:
    python高级 之(三) --- 高阶函数
    python高级 之(二) --- 类装饰器
    python高级 之(一) --- 函数类型
    jQuery
    css
    html
    px2rem
    keep-alive标签
    rem适配方案2(flexible.js)
    媒体查询
  • 原文地址:https://www.cnblogs.com/littlehoom/p/3659355.html
Copyright © 2011-2022 走看看