所以,我一直在通过stackoverflow和其他互联网论坛和知识库搜索相似的主题,但到目前为止,我没有运气试图解决这个问题,我一直在努力整整一周.这是代码:
private void matrículasToolStripMenuItem_Click(object sender, EventArgs e)
{
Form1 form1 = new Form1();
form1.Show();
form1.MdiParent = this; // this == the main form of the aplication, wich has IsMdiParent property set to true.
}
Run Code Online (Sandbox Code Playgroud)
如果我取出"form1.MdiParent = this",form1的显示事件将正常触发,执行其所有处理程序的内容,但如果我让它在那里,显示的form1事件将不会触发(我确实设置了breakpoits,none他们被触发了).
奇怪的是,如果我使用Load事件而不是显示,一切正常,但我有点害怕交换显示负载会破坏一些东西:(.