单击 MDI 子窗体不会将其置于前面
这是.net中的一个winform问题。
在 MDI 窗体中,如果我打开多个子窗体,对于某些窗体,如果它们未激活(如果将它们与激活的窗体重叠,则它们不会位于最前面。只有激活的窗体位于最前面。),单击他们不会把他们带到前面。如果我单击它们上的控件(例如文本框),情况也是如此。文本框获得焦点,您可以输入内容,但该表单仍未激活。
有趣的是,我创建的所有子表单的情况并非如此。有些表单行为正确,但其他表单则不然。我做错了什么吗?
我认为正确的行为是,每次单击表单时,将其置于最前面。
感谢您的任何建议。
This is a winform question in .net.
In a MDI form, if I open several children forms, for some forms, if they are not activated (if you overlap them with the activate one, they are not up to front. Only the activate form is up to front.), clicking them don't bring them to front. This is even true if I click controls on them, such as a textbox. The textbox gets focus and you can intput things, but that form is still not activated.
Interestingly enough, this is not the case for all the children forms I created. Some forms behave correctly but others don't. Did I do something wrong?
I think the correct behavior is that, everytime I click a form, bring it up to front.
Thank you for any suggestion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
childForm.MdiParent = Me
childForm.WindowState = FormWindowState.Maximized
childForm.Show()
childForm.Focus()
childForm.MdiParent = Me
childForm.WindowState = FormWindowState.Maximized
childForm.Show()
childForm.Focus()
试试这个
childForm.ShowDialog(我)
try this
childForm.ShowDialog(Me)