c# - 将类别添加到 .NET PropertyGrid

标签 c# .net propertygrid categories

是否只能通过使用 CategoryAttribute 等属性注释我的数据类来向 .NET PropertyGrid 添加类别?

最佳答案

您可以使用 CategoryAttribute .文档指出:

A new category can be created for any name by specifying the name of the category in the constructor for the CategoryAttribute.

例子:

[
Category("MyCategory"),
Description("Specifies something")
]
public string Something { //... }

关于c# - 将类别添加到 .NET PropertyGrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4783146/

相关文章:

c# - 反射发射生成简单的继承

c# - 为什么 StackPanel 不垂直拉伸(stretch)它的子项?

c# - 转换RGB方法?

c# - 我可以 "stop"一个 LINQ 方法链中途吗?

c# - ElasticSearch中的'and' 'Or'查询

c# - 如何允许用户在 PropertyGrid 中设置表达式来确定属性值

c# 窗体控件中的嵌套类(子类) “property grid”

c# - Extended WPF Toolkit propertygrid 是否支持 Typeconverter 属性

C#:动态添加字段到类

C# MySQL 插入、删除、更新按钮?