C# MDI 子窗体被父窗体Panel挡住

Return0623360 Return0623360 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
父窗体上有Panel控件(panel上放置别的有用的控件),打开子窗体后,子窗体却会被这个Panel挡住.请问有什么解决方法吗?
当我把Panel控件去掉后,子窗口也是位于父窗口的下面,已经把TopMost属性置为true,但还是位于下面,怎么破?
网上使用如下方法可以解决:
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);

我试了一下,怎么就不行咧?
[DllImport("user32")]
public static extern int SetParent(int hWndChild, int hWndNewParent);
这两句是干啥子的?不太懂,菜鸟一枚,望解答。。。
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
Return0623360
C# 111,128 成员 642,536 内容