问题描述
如果用户已停止在文本框中键入内容,我尝试创建正在监听的方法.我尝试通过以下主题中的线程解决此问题:
如何中止特定 [ ^ ]
我遵循了他们使用BackgroundWorker的指导,但是它似乎也不起作用(我是线程技术的新手).
我想要的是创建一个侦听用户停止在文本框中键入内容的方法,并且在2秒钟的超时后(例如),它运行另一个方法来验证文本框的输入.
有没有人可以给我提示如何创建此方法?
我对此方法有要求:
I have tried creating method that is listeneing if the user has stopped typing in a textbox. I tried to solve this problem with Threading as in the following topic:
How do I abort a specific thread that is already running?[^]
I followed their guidiance of using BackgroundWorker but it doesn''t seem to work either (I am new to threading).
What I want is to create a method that listens if the user has stopped typing in a textbox and after a timeout of 2 seconds (as an example) it runs another method that validates the input of the textbox.
Is there someone that can give me a hint of how to create this method?
I have a requirement for this method:
It must be able to be reused with different textboxes.
推荐答案
这篇关于如何创建密钥侦听器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!