C# Winforms 文本框的焦点丢失事件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1786369/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Focus Lost event for a Winforms TextBox?
提问by Joan Venge
Which event should I use for this?
我应该为此使用哪个事件?
采纳答案by Joey
Control.Leaveor Control.LostFocus:
Control.Leave或Control.LostFocus:
When you change the focus by using the keyboard (?, ?+?, and so on), by calling the Selector SelectNextControlmethods, or by setting the ContainerControl.ActiveControlproperty to the current form, focus events occur in the following order:
When you change the focus by using the mouse or by calling the Focusmethod, focus events occur in the following order:
If the CausesValidationproperty is set to false, the Validatingand Validatedevents are suppressed.
当您使用键盘(?、?+?等)、通过调用Select或SelectNextControl方法或通过将ContainerControl.ActiveControl属性设置为当前窗体来更改焦点时,焦点事件将按以下顺序发生:
当您使用鼠标或通过调用Focus方法更改焦点时,焦点事件按以下顺序发生:
如果CausesValidation属性设置为 false,则Validating和Validated事件将被抑制。
回答by Wil P
Control.LostFocus.
控制。失去焦点。
回答by Martin Robins
'Control.LostFocus'
'Control.LostFocus'