110,925
社区成员
发帖
与我相关
我的任务
分享
FrmLogin frmLogin = new FrmLogin(); //设置为全局变量
private void button5_Click(object sender, EventArgs e)
{
frmLogin.TopLevel = false; ;
panel1.Controls.Add(frmLogin);
frmLogin.Dock = DockStyle.Fill;
frmLogin.Show();
orderManage.Hide();
}[code=C#]
[/code]
//控制窗体移动
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, 0x0112, 0xF012, 0);
}
private void ShowForm(Form frm)
{
Form.TopLevel = false; ;
panel1.Controls.Add(Form);
Form.Dock = DockStyle.Fill;
Form.Show();
orderManage.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
ShowForm(frmLogin);
}
private void button2_Click(object sender, EventArgs e)
{
ShowForm(frmLogin);
}