框TextChanged [英] TextChanged
问题描述
TextBox.TextChanged即使文本被更改,事件也会触发
以编程方式。如何检测用户已经更改了文本
并且没有以编程方式更改?
谢谢
TextBox.TextChanged Event fires even when the text is changed
programatically. How can I detect that the text has been changed by the user
and not changed programatically?
Thanks
推荐答案
你好看看
Keydown或keyup活动
Greetz Peter
Nice Chap <镍****** @ PlasmaDyne.com> schreef in bericht
news:e8 ************** @ tk2msftngp13.phx.gbl ...
Hi look at the
Keydown or keyup event
Greetz Peter
"Nice Chap" <Ni******@PlasmaDyne.com> schreef in bericht
news:e8**************@tk2msftngp13.phx.gbl...
TextBox.TextChanged事件触发即使文本以编程方式更改了。如何检测
用户是否已更改文本而不是以编程方式更改?
TextBox.TextChanged Event fires even when the text is changed
programatically. How can I detect that the text has been changed by the user and not changed programatically?
Thanks
>
Nice Chap,
两种方式。
设置一个布尔开关来评估事件
或
以编程方式删除处理程序
以编程方式执行此操作(并在之后设置(返回))
我希望这会有所帮助,
Cor
Nice Chap,
Two ways.
Set a Boolean switch to evaluate that in the event
or
delete the handler when you do it programmatically
When you do it programmatically (and set it (back) afterwards)
I hope this helps,
Cor
" Nice Chap" <镍****** @ PlasmaDyne.com> schrieb:
"Nice Chap" <Ni******@PlasmaDyne.com> schrieb:
TextBox.TextChanged即使文本被更改,事件也会以编程方式触发。如何检测文本是否已由
用户更改而不是以编程方式更改?
TextBox.TextChanged Event fires even when the text is changed
programatically. How can I detect that the text has been changed by the
user and not changed programatically?
您可能想要设置一个标志(例如,在以编程方式更改值之前设置控件的'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' />
-
MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://classicvb.org/petition/>
You may want to set a flag (for example, by setting the control''s ''Tag''
property) before changing the value programmatically and check this flag in
the ''TextChanged'' event handler.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
这篇关于框TextChanged的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!