由网友(日落时的沧桑)分享简介:我有一个PropertyGrid的是一个对象,具有以下属性类别上使用:样式,演算和其它I got a PropertyGrid that is use on an object that have the following property category : Style, Calcul and Misc我要的...
我有一个PropertyGrid的是一个对象,具有以下属性类别上使用:样式,演算和其它
I got a PropertyGrid that is use on an object that have the following property category : Style, Calcul and Misc
我要的是只显示给用户的演算类,但我不希望使用浏览的属性,因为我希望所有这些属性在Visual Studio中可见。
What I want is to only show to the user the Calcul category, but I don't want to use the browsable attribute because I want all these property to be visible in Visual studio.
所以,我需要的,是一个IN- code解决方案。
So, what I need, is an in-code solution.
我使用。NET 3.5 C#
I use .Net 3.5 c#
推荐答案
的PropertyGrid
有一个属性 - BrowsableAttributes
;这个分配您的类别:
PropertyGrid
has a property - BrowsableAttributes
; assign this your categories:
propGrid.BrowsableAttributes = new AttributeCollection(
new CategoryAttribute("Calcul"));
和(希望),它应该工作。
And (hopefully) it should work.
相关推荐
最新文章