WinForm程序如何将子窗体嵌入到父窗体的Panel里
1个回答
展开全部
主要通过SetParent实现:
[DllImport("user32.dll", EntryPoint = "SetParent")]
public static extern int SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
MDIParent1 form = new MDIParent1();
SetParent(form.Handle, this.Panel1.Handle);
form.Location = new Point(0, 0);
form.Size = this.Size;
form.Show();
参考下:
http://www.cnblogs.com/icyJ/archive/2013/07/26/SetParent.html
[DllImport("user32.dll", EntryPoint = "SetParent")]
public static extern int SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
MDIParent1 form = new MDIParent1();
SetParent(form.Handle, this.Panel1.Handle);
form.Location = new Point(0, 0);
form.Size = this.Size;
form.Show();
参考下:
http://www.cnblogs.com/icyJ/archive/2013/07/26/SetParent.html
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询