如何检测Tab Control何时失去焦点 [英] How to detect when Tab Control loses its focus

查看:66
本文介绍了如何检测Tab Control何时失去焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我有一个WinForm应用程序。该表单有一个Tab Control和一个

ToolStrip。我想知道什么是最好的方法来检测用户是什么时候离开?选项卡控件和移动选项卡进入ToolStrip。


谢谢

EitanB

Hello,

I have a WinForm application. The form has one Tab Control and one
ToolStrip. I would like to know what would be the best way to detect when
the user is "leaving" the Tab Control and "moving" into ToolStrip.

Thank you
EitanB

推荐答案


您可以处理TabControl的''Leave'事件,以了解此对象何时失去焦点以及ToolStrip的'Enter'事件以了解工具条何时

得到焦点。


阿德里安。

-

[请注明我的答案,如果它对你很有帮助]



" Eitan"写道:

You can handle the ''Leave'' event of the TabControl to know when this object
loses focus and the ''Enter'' event of the ToolStrip to know when the toolstrip
gets the focus.

Adrian.
--
[Please mark my answer if it was helpful to you]


"Eitan" wrote:

您好,


我有一个WinForm应用程序。该表单有一个Tab Control和一个

ToolStrip。我想知道什么是最好的方法来检测用户是什么时候离开?选项卡控件和移动选项卡进入ToolStrip。


谢谢

EitanB
Hello,

I have a WinForm application. The form has one Tab Control and one
ToolStrip. I would like to know what would be the best way to detect when
the user is "leaving" the Tab Control and "moving" into ToolStrip.

Thank you
EitanB


您好,

当我按下ToolStrip上的一个

控件时,不会触发Tab控件上的保留.....只有当我切换标签时才触发。


谢谢

Eitan


" Adrian Voicu"写道:
Hello,

The leave on the Tab Control is not triggered when I press one of the
controls on the ToolStrip..... It only triggers when I switch tabs.

Thank you
Eitan

"Adrian Voicu" wrote:

>

您可以处理TabControl的''Leave'事件以了解此对象何时

失去了焦点和ToolStrip的'Enter'事件,知道工具条

何时成为焦点。


Adrian。

-

[如果对你有帮助,请标明我的答案]



" Eitan"写道:
>
You can handle the ''Leave'' event of the TabControl to know when this object
loses focus and the ''Enter'' event of the ToolStrip to know when the toolstrip
gets the focus.

Adrian.
--
[Please mark my answer if it was helpful to you]


"Eitan" wrote:

您好,


我有一个WinForm应用程序。该表单有一个Tab Control和一个

ToolStrip。我想知道什么是最好的方法来检测用户是什么时候离开?选项卡控件和移动选项卡进入ToolStrip。


谢谢

EitanB
Hello,

I have a WinForm application. The form has one Tab Control and one
ToolStrip. I would like to know what would be the best way to detect when
the user is "leaving" the Tab Control and "moving" into ToolStrip.

Thank you
EitanB


Eitan写道:
Eitan wrote:

您好,


我有一个WinForm应用程序。该表单有一个Tab Control和一个

ToolStrip。我想知道什么是最好的方法来检测用户是什么时候离开?选项卡控件和移动选项卡进入ToolStrip。
Hello,

I have a WinForm application. The form has one Tab Control and one
ToolStrip. I would like to know what would be the best way to detect when
the user is "leaving" the Tab Control and "moving" into ToolStrip.



我希望Control类中的Enter和Leave事件能够提供这些信息。这不适合你吗?

I would expect the Enter and Leave events in the Control class to
provide that information. Is this not working for you?


这篇关于如何检测Tab Control何时失去焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆