日期:2014-05-18  浏览次数:20773 次

按钮问题(续)
Button b = (Button)sender;
  b.Text = "完成";
实现了 单击按钮 改变按钮名字。
如何实现按其他按钮时候该按钮返回原来的显示值
比如Button1原显示值为 “OK” 单击后显示为 “完成”再单击其他按钮Buttonx时 Button1显示值又返回为“OK”


------解决方案--------------------
在其他Buttonx的Click事件里写
 button1.text="OK";
------解决方案--------------------
另一个button click事件里
button1.text = "OK";

------解决方案--------------------
Button b = (Button)sender; 
if( b.Text == "完成")
b.Text = "OK";
else
b.Text = "完成";