更改单击按钮的内容 [英] Changing content of button on click

查看:100
本文介绍了更改单击按钮的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在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 the Button.Tag property to hold the existing value of the Content property, perform your operation in a background thread, then when complete, set the Content property to the value you previously stored in the Tag property.

Here is an example of the threading in WPF.
http://msdn.microsoft.com/en-us/library/ms741870.aspx[^]


这篇关于更改单击按钮的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆