//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();
}

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2021-10-29
  • 2021-12-26
  • 2021-07-06
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案