
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags)
private void SoftBoardBTN_Click(object sender, EventArgs e)
{
Process p1= Process.Start("SoftBoard.exe")
SetWindowPos(p1.MainForm.Handle, -1, 0, 0, 0, 0, 1 | 2)//最后参数也有用1 | 4
p1.MainForm.Handle 我记得这个是MainForm吧 反正是主窗口
}
this.Handle 改成
C#中调用窗体和隐藏窗体的方法分别为Show()和Hide()form1.Show()
form2.Hide()
form3.Hide()
显示其它窗体类似处理
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)