工具条容器工具条失去焦点和双击
VB.Net 2008 Express Edition
“Form1”有一个 ToolStripContainer1.TopToolStripPanel,其中包含一个带有按钮的 ToolStrip。当“Form1”处于活动状态时,只需单击一下即可使用这些按钮。如果我单击另一个窗口,然后返回到“Form1”,则 ToolStrip 按钮需要单击两次才能激活。第一次单击将焦点返回到“Form1”,随后的单击将触发按钮事件。我希望按钮在第一次单击时起作用,而不需要单击两次。
请注意,“Form1”上不属于 ToolStrip 一部分的普通按钮在从另一个窗口/窗体返回时第一次单击时起作用!!!!????
VB.Net 2008 Express Edition
"Form1" has a ToolStripContainer1.TopToolStripPanel which contains a ToolStrip with buttons. The buttons work on ONE click when "Form1" is active. If I click on another window and then return to "Form1" the ToolStrip buttons take TWO clicks to activate. The first click returns focus to "Form1" and the subsequent click fires the button event. I want the buttons to work on the first click and not require two clicks.
Note that ordinary buttons on "Form1" that are not part of the ToolStrip work on the first click when returning from another window/form!!!!????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是标准行为。您可以看到,如果 Microsoft Outlook 没有焦点并且您单击屏幕上可见的工具按钮,它也会执行相同的操作。
但您可以使用自己的版本覆盖该行为:
That's standard behavior. You can see Microsoft Outlook does the same thing if it doesn't have focus and you click on a tool button that is visible on the screen.
But you can override that behavior with your own version: