110,534
社区成员
发帖
与我相关
我的任务
分享
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern bool BringWindowToTop(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
private void button1_Click(object sender, EventArgs e)
{
SetParent(FrmMain.Handle, (IntPtr)int.Parse(textBox1.Text));
BringWindowToTop(FrmMain.Handle);
}
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern bool BringWindowToTop(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
private void button1_Click(object sender, EventArgs e)
{
SetParent(FrmMain.Handle, (IntPtr)int.Parse(textBox3.Text));
BringWindowToTop(FrmMain.Handle);
}