VB.NET MDI Children 仅关注标题栏单击
人们可能会想象,单击 MDI 子窗体(或任何控件)中的任意位置都会聚焦该窗体。但在我的应用程序中,我只能通过单击其标题栏来聚焦 MDI 子项,这是用户的异常行为。我的表单充满了控件或面板,因此我无法仅仅“单击表单”。但单击其中的任何位置都应该将其聚焦。
尽管其他人似乎也遇到了这个问题,但我一直无法找到解决方案。
One would imagine that clicking anywhere within the MDI Child form (or on any control) will focus that form. But in my application I can only focus a MDI child by clicking on its titlebar, which is an abnormal behavior on the part of the user. My forms are filled with either controls or panels so I don't have the luxury of just "clicking on the form." But clicking anywhere within it should focus it.
I haven't been able to find a solution to this problem although it seems others are having it as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。如果您在调用
Form.Show
之后设置子表单mdiParent
属性,那么它会扰乱所有子表单的焦点。当我首先设置表单的
mdiParent
属性然后调用.Show()
时,一切都按预期完美运行。I figured it out. If you are setting the child form
mdiParent
property after you are callingForm.Show
then it messes up the focus of all the child forms.When I set
mdiParent
property of the form first and then call.Show()
, everything works perfectly as expected.