国产探花免费观看_亚洲丰满少妇自慰呻吟_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); // 自下而上。
        }
    }
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 仪陇县| 北宁市| 山东| 普洱| 黔西县| 宜宾县| 义乌市| 黄陵县| 辽阳县| 龙井市| 镇江市| 兴文县| 昔阳县| 虹口区| 通榆县| 固原市| 清涧县| 万宁市| 鄂温| 车致| 莱芜市| 湘潭县| 海晏县| 枣阳市| 金华市| 江口县| 麻阳| 四平市| 裕民县| 洛浦县| 庄河市| 廉江市| 江孜县| 太保市| 东乡族自治县| 威远县| 石嘴山市| 马鞍山市| 始兴县| 大新县| 临泽县|