博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C# MDI 子窗体被父窗体控件挡住

Posted on 2014-08-22 10:54  快乐家++  阅读(3116)  评论(0编辑  收藏  举报

 

using System.Runtime.InteropServices;

[DllImport("user32")]
public static extern int SetParent(int hWndChild, int hWndNewParent);

  Form2 f2 = new Form2();
  f2.MdiParent = this;
  f2.Show();
  SetParent((int)f2.Handle, (int)this.Handle);