Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 属性向控件及其父级指示_C#_.net_Asp.net_Html_Panel - Fatal编程技术网

C# 属性向控件及其父级指示

C# 属性向控件及其父级指示,c#,.net,asp.net,html,panel,C#,.net,Asp.net,Html,Panel,问: 最近,我问了一个关于设置(Visible)属性的问题,当我将其设置为true时,我惊讶地发现在将其设置为true后进行跟踪。它的值仍然为false。答案对我来说是一个惊喜: - "The Visible property has a special property: when you read the value it not only reports on the control itself but also on it's parent. The valu

问:

最近,我问了一个关于设置(
Visible
)属性的问题,当我将其设置为true时,我惊讶地发现在将其设置为true后进行跟踪。它的值仍然为false。答案对我来说是一个惊喜:

 - "The Visible property has a special
   property: when you read the value it
   not only reports on the control
   itself but also on it's parent. The
   value you get is the "real"
   visibility."

我的问题是:有没有任何财产,你以前遇到过类似(
Visible
)的行为?我们应该如何以最佳方式使用它们?

嗯,我不知道,试试这个查询:

var lst =Control.Properties.Where(p => HasSimilarBehaviourToVisibleProperty(p));
您只需要编写
hasBehaviorLikeVisibleProperty
方法


注意:您可能需要反射来获取所有属性。(查看以获取属性)

已启用可以是这种方式的一个属性。

你是什么意思。。不清楚我希望所有属性的行为类似(
可见
)。