c#创建子窗口时,子窗口无法获得焦点,总出现在父窗口控件的后面……
代码:namespaceexperiment{publicpartialclassForm1:Form{publicForm1(){this.IsMdiContainer...
代码:
namespace experiment
{
public partial class Form1 : Form
{
public Form1()
{
this.IsMdiContainer = true;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.MdiParent = this;
frm.Show();
frm.Focus();
}
}
}
运行截图 展开
namespace experiment
{
public partial class Form1 : Form
{
public Form1()
{
this.IsMdiContainer = true;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.MdiParent = this;
frm.Show();
frm.Focus();
}
}
}
运行截图 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询