using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
}
private const int SW_HIDE = 0;
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWMAXIMIZED = 3;
private const int SW_SHOWNOACTIVATE = 4;
private const int SW_RESTORE = 9;
private const int SW_SHOWDEFAULT = 10;
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
private void button1_Click(object sender, EventArgs e)
{//最小化显示窗体
ShowWindowAsync(this.Handle, SW_SHOWMINIMIZED);
}
private void button2_Click(object sender, EventArgs e)
{//最大化显示窗体
ShowWindowAsync(this.Handle, SW_SHOWMAXIMIZED);
}
private void button3_Click(object sender, EventArgs e)
{//还原显示窗体
ShowWindowAsync(this.Handle, SW_RESTORE);
}
}
}
|
请发表评论