我有一个文本框控件,它有时以编程方式更新,也可以由用户更新.我如何区分这两个事件?我想要一个Dirty"标志设置为真";当用户更改文本时.
I have a Textbox control which sometimes updated programmatically and also can be update by the user. How can I distinct between those two event? I'd like to have a "Dirty" flag set to "True" when the user changes the text.
可以使用文本框的Key Down事件.
You can use the Key Down event of the text box.
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
// Insert the code you want to run when the text changes here!
}
这篇关于仅用于用户输入的 TextBox 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!