label.Text更改了事件 [英] label.Text changed event
本文介绍了label.Text更改了事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在标签文本事件发生变化时实现方法。如何实现它?
I want to implement method on the event of label text is changed. how to implement it?
推荐答案
没有这样的事件是asp.net但你可以使用JQuery实现类似的功能。
检查这些链接以获取更多信息 -
Jquery中的asp标签文本更改事件 [ ^ ]
如何在标签文本更改时触发事件 [ ^ ]
希望,它有帮助:)
There is no such event is asp.net but you can achieve similar functionality using JQuery.
Check these links for further information-
asp label text changed event in Jquery[^]
how to fire event on label text change[^]
Hope, it helps :)
标签没有更改文字事件,因为他们无法接收键盘焦点,因此所有更改必须归结为您自己的代码而不是用户操作。
如果您需要更改事件,您的代码操作的结果,然后考虑使用只读的TextBox。
Labels don't have text changed events, because they can't receive the keyboard focus, so all changes must be down to your own code rather than user actions.
If you need a change event as a result of your code actions, then consider using a read-only TextBox instead.
试试这样:
Try it like this :
private void Label3_TextChanged(System.Object sender, System.EventArgs e)
{
Button3.Text += "-";
}
private void Button3_Click(System.Object sender, System.EventArgs e)
{
Label3.Text += "x";
}
这篇关于label.Text更改了事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文