日期:2014-05-18  浏览次数:20937 次

C# 子窗口显示问题
我在MDI的主窗口中添加了treeview,textbox,picturebox等控件
我在一个click事件中show()了子窗口
但是发现子窗口是被覆盖在treeview,picturebox这些控件的下面的
请问如何让这个子窗口现在到这些控件的上面来呢??

都找不到相关的解答。。

------解决方案--------------------
解决了:
using System.Runtime.InteropServices;

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

//价格temp2是你的子form
temp2.MdiParent = this;
temp2.Show();
SetParent((int)temp2.Handle, (int)this.Handle);