隐藏和显示按钮内容 [英] Hide and Display Button Content

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

问题描述

<Button Name="Dog" Content="Dog" Height="80" FontSize="17" Width="{Binding RelativeSource={RelativeSource Self},Path=Height}" Click="Dog_Click"/>







当我点击按钮时,内容狗是可见的,否则它应该隐藏..所以该怎么做???




When i click the button, the content "Dog" is got visible, otherwise it should hide.. so how to do???

推荐答案

在按钮点击处理程序上分配按钮的Content属性。
Assign Content property of button on button click handler.


根据我的理解,我已经完成了这个,

Based on my understanding, I've done this,
<Button Name="Dog" Content="" Height="80" FontSize="17" Width="{Binding RelativeSource={RelativeSource Self},Path=Height}" Click="Dog_Click"/>




protected void Dog_Click(...)
{
    Dog.Content = "Dog";
}





-KR



-KR


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

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