更改单击按钮的内容 [英] Changing content of button on click
本文介绍了更改单击按钮的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在WPF应用程序中有一个按钮.我想更改click事件的内容,并在进行一些处理后保留其旧值..
有任何建议..
在此先谢谢您..
Hi all,
i have a button in wpf application. i want to change the content on click event and after some processsing it retain its old value..
Any suggestion..
Thanks in Advance..
推荐答案
您可以使用Button.Tag
属性保存Content
属性的现有值,在后台线程中执行操作,然后在完成后,将Content
属性设置为先前存储在Tag
属性中的值.
这是WPF中的线程示例.
http://msdn.microsoft.com/en-us/library/ms741870.aspx [ ^ ]
You could use theButton.Tag
property to hold the existing value of theContent
property, perform your operation in a background thread, then when complete, set theContent
property to the value you previously stored in theTag
property.
Here is an example of the threading in WPF.
http://msdn.microsoft.com/en-us/library/ms741870.aspx[^]
这篇关于更改单击按钮的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文