111,126
社区成员
发帖
与我相关
我的任务
分享namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Form frm = null;
private void btnOpen_Click(object sender, EventArgs e)
{
if (frm == null) ;
frm = new Form2();
frm.Show();
}
private void btnClose_Click(object sender, EventArgs e)
{
if (frm != null && frm.Visible)
{
frm.Close();
frm = null;
}
}
}
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
static public extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);