Event for “end edit” in a text box

2019-07-06 00:04发布

I am using a textbox in winform (c#) and using the text of to make consults in a database.

But i need constantly consult the text of the textbox every time that text change. So for these i use the KeyUp. But this event is too slow.

Is any event that just fire when the textbox editing has been finished ?. I consider for finish 2 conditions

The control lost focus. The control has 200ms without keypress

2条回答
ゆ 、 Hurt°
2楼-- · 2019-07-06 00:55

You mean something like this?

Control.LostFocus

Provided that you consider finished as being when they click off the textbox.

查看更多
【Aperson】
3楼-- · 2019-07-06 00:59

You could use the LostFocus event, to capture when the user clicks on a control outside the textbox.

Otherwise, you'll need to choose from one of the existing events. (Listed here)

Come to think of it, you will likely have to capture multiple events. DragDrop if someone copies/pastes, for example...

查看更多
登录 后发表回答