|
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace 窗口特效
- {
- public partial class Form1 : Form
- {
- [System.Runtime.InteropServices.DllImport("user32.dll")]
- private static extern bool AnimateWindow(IntPtr hwnd, int time, int flag);
- private const int AW_SLIDE = 262144; //滑动
- private const int AW_VER_POSITIVE = 4; //自顶向下
- private const int AW_ACTIVATE = 131072; //激活窗口
- private const int AW_BLEND = 524288; //淡入淡出
- private const int AW_HIDE = 65536; //隐藏窗口
- private const int AW_CENTER = 16; //向内或向外重叠
- private const int AW_HOR_POSITIVE = 1; //自左向右
- private const int AW_VER_NEGATIVE = 8; //自下向上
- private const int AW_HOR_NEGATIVE = 2; //自右向左
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- AnimateWindow(Handle, 1000, AW_CENTER);
- }
- }
- }
复制代码 |
|