//using System.Runtime.InteropServices;
[DllImport(
"
coredll
"
)]
private
static
extern
bool
ShowWindow(IntPtr hwnd,
int
nCmdShow);
private
const
int
SW_MINIMIZE
=
6
;
private
void
mniHide_Click(
object
sender, EventArgs e)
{
// 隐藏窗体,可以通过重新运行程序来显示窗体
ShowWindow(
this
.Handle, SW_MINIMIZE);
}
private
void
mniExit_Click(
object
sender, EventArgs e)
{
// 关闭窗体,窗体对象将会被销毁
this
.Close();
}
转载于:https://www.cnblogs.com/yunxizfj/archive/2008/05/22/1205098.html