- using System;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
-
- namespace animation
- {
- public partial class Form1 : Form
- {
- enum AnimateWindowFlags : uint
- {
- AW_HOR_POSITIVE = 0x00000001,
- AW_HOR_NEGATIVE = 0x00000002,
- AW_VER_POSITIVE = 0x00000004,
- AW_VER_NEGATIVE = 0x00000008,
- AW_CENTER = 0x00000010,
- AW_HIDE = 0x00010000,
- AW_ACTIVATE = 0x00020000,
- AW_SLIDE = 0x00040000,
- AW_BLEND = 0x00080000
- }
-
- public Form1()
- {
- InitializeComponent();
- }
-
- [DllImport("user32.dll")]
- static extern bool AnimateWindow(IntPtr hwnd, uint dwTime, uint dwFlags);
- [DllImport("user32")]
- static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);
-
- private void button1_Click(object sender, EventArgs e)
- {
- Form1 f2 = new Form1();
- AnimateWindow(f2.Handle, 1000, (uint)AnimateWindowFlags.AW_VER_NEGATIVE |
- (uint)AnimateWindowFlags.AW_SLIDE);
- f2.Show();
- }
- }
- }
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace animation
{
public partial class Form1 : Form
{
enum AnimateWindowFlags : uint
{
AW_HOR_POSITIVE = 0x00000001,
AW_HOR_NEGATIVE = 0x00000002,
AW_VER_POSITIVE = 0x00000004,
AW_VER_NEGATIVE = 0x00000008,
AW_CENTER = 0x00000010,
AW_HIDE = 0x00010000,
AW_ACTIVATE = 0x00020000,
AW_SLIDE = 0x00040000,
AW_BLEND = 0x00080000
}
public Form1()
{
InitializeComponent();
}
[DllImport("user32.dll")]
static extern bool AnimateWindow(IntPtr hwnd, uint dwTime, uint dwFlags);
[DllImport("user32")]
static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);
private void button1_Click(object sender, EventArgs e)
{
Form1 f2 = new Form1();
AnimateWindow(f2.Handle, 1000, (uint)AnimateWindowFlags.AW_VER_NEGATIVE |
(uint)AnimateWindowFlags.AW_SLIDE);
f2.Show();
}
}
}