属性向控件及其父级指示

发布于 2024-11-02 20:03:15 字数 422 浏览 2 评论 0原文

问:

最近,我询问了一个有关设置 (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)相同?我们应该如何最好地使用它们?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

木槿暧夏七纪年 2024-11-09 20:03:15

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

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

您只需要编写 HasBehaviourLikeVisibleProperty 方法。

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

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)

哆啦不做梦 2024-11-09 20:03:15

Enabled 可以是这种方式的一个属性。

Enabled could be one property in this fashion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文