开发者

properties indicate to the control and its parents

Q:

Lately,i asked about an issue concerning setting the (Visible)property ,when i set it to true , i surprised in tracing after setting it to true.that its value is still false. the answer was a surprise for me :

 - 开发者_运维百科"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."

My question is : is there any property, you meet before behave in the same manner like (Visible)? and how we should use them in the best way?


Hmm, I don't know, try this query:

var lst =Control.Properties.Where(p => HasSimilarBehaviourToVisibleProperty(p));

You just need to write HasBehaviourLikeVisibleProperty method.

Note: You might need reflection to get all properties. (Have a look here to get properties)


Enabled could be one property in this fashion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜