控制C#中的可见性 [英] controls visibility in C#

查看:202
本文介绍了控制C#中的可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使控件显示为真或假。目前,我正在后面的代码中设置这样的面板控件可见性。我正在比较Username和UserId的值。如果两个值都相同。.我将面板可见性设置为false

How to make a control visibilty to true or false. currently i am setting a panel control visibility like this in code behind. i am comparing the values of Username and UserId. If both the values are same..i am setting panel visibility to false

               if (UserName == UserID))
                {
                    pnl_linkbuttons.Visible = false;
                }

是否有其他方法可以从后面的代码中设置C#中的控件可见性。

is there any alternative way to set the control visibility in C# from code behind.

预先感谢。

推荐答案

pnl_linkbuttons.Visible = UserName == UserID;

这篇关于控制C#中的可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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