简体   繁体   English

如何防止单个MDI子窗体窃取其他所有MDI子窗体的焦点

[英]how to prevent a single MDI child form stealing focus from every other mdi child form

There are several MDI child form within my window, one of MDI child form after it's being launched will cause the focus mechanism to be weird, meaning a another MDI child window will not get the focus unless the title bar is clicked, clicking anywhere else in the mdi child form will not caused the form to focus. 我的窗口中有几个MDI子窗体,其中一个MDI子窗体启动后将导致焦点机制变得怪异,这意味着除非单击标题栏,单击标题栏中的其他任何位置,否则另一个MDI子窗口将不会获得焦点。 MDI子窗体不会导致窗体集中。

any thoughts? 有什么想法吗?

I would put this as a comment if I had enough rep since it's only a guess because there isn't a lot of information in the question. 如果我有足够的代表,我将其作为评论,因为这只是一个猜测,因为问题中没有很多信息。

Try making sure that the MDI children are handling the click event to make sure that focus is being set to the form that is being clicked on. 尝试确保MDI子级正在处理click事件,以确保将焦点设置为所单击的窗体。 I haven't ever really noticed behavior like this the only think of is you are somehow overriding the default mouseclick behavior on the other MDI children that are being populated, but since I don't think you can override the title bar click I think this is why it still works. 我从来没有真正注意到过这样的行为,唯一想到的就是您以某种方式覆盖了正在填充的其他MDI子级的默认mouseclick行为,但是由于我认为您无法覆盖标题栏,所以我认为这就是为什么它仍然有效的原因。

Could explain what you're doing inside of the MDI child a little so we can get a better understanding of what is going on that could be causing this behavior. 可以稍微解释一下您在MDI子内部所做的事情,这样我们就可以更好地了解可能导致此行为的正在发生的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM