国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C# 動畫窗體(AnimateWindow)的小例子

2020-01-24 03:31:32
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace WinFormTitle
{
    public partial class FormTitle : Form
    {
        [DllImport("user32.dll", EntryPoint = "AnimateWindow")]
        private static extern bool AnimateWindow(IntPtr handle, int ms, int flags);

        public FormTitle()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            AnimateWindow(this.Handle, 1000, 0x20010);   // 居中逐漸顯示。
            //AnimateWindow(this.Handle, 1000, 0xA0000); // 淡入淡出效果。
            //AnimateWindow(this.Handle, 1000, 0x60004); // 自上向下。
            //AnimateWindow(this.Handle, 1000, 0x20004); // 自上向下。
        }

        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);
            AnimateWindow(this.Handle, 1000, 0x10010);    // 居中逐漸隱藏。
            //AnimateWindow(this.Handle, 1000, 0x90000); // 淡入淡出效果。
            //AnimateWindow(this.Handle, 1000, 0x50008); // 自下而上。
            //AnimateWindow(this.Handle, 1000, 0x10008); // 自下而上。
        }
    }
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芒康县| 青海省| 景谷| 额尔古纳市| 宁南县| 尼勒克县| 左贡县| 成都市| 竹溪县| 温州市| 同心县| 金山区| 嘉峪关市| 体育| 高雄市| 海南省| 崇信县| 策勒县| 澄迈县| 务川| 麻城市| 响水县| 绥德县| 杭州市| 建昌县| 和顺县| 宁陕县| 玉田县| 新田县| 元氏县| 涡阳县| 隆回县| 改则县| 基隆市| 甘孜县| 济阳县| 勐海县| 崇明县| 太仓市| 临汾市| 孙吴县|