如何在PropertyGrid中动态启用/禁用属性 [英] How to dynamically enable/disable property in PropertyGrid

查看:244
本文介绍了如何在PropertyGrid中动态启用/禁用属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

何时构建PropertyGrid以具有对象类的属性表,
通常我们必须在对象类中为属性项编写属性,现在,我将动态更改属性之一以具有不同的属性设置,例如从BrowsableAttribute(true)更改为BrowsableAttribute(false),在运行时如何我达到这个目标了吗?有示例代码可供参考吗?谢谢.

When to build a PropertyGrid to have a porperty table for an object class,
normally we have to write attribute for property item in object class, and now, I would dynamically change one of property to have different attribute setting, such as from BrowsableAttribute(true) to be BrowsableAttribute(false),in run-time, how can I reach this goal ? Is there any sample code for reference ? Thanks.

推荐答案

Enabling/disabling properties at runtime in the PropertyGrid[^]
Check this, try something, and come back if there''s any problem. :thumbsup:


这篇关于如何在PropertyGrid中动态启用/禁用属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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