怎样隐藏PropertyGrid中的集合编辑器

benbenRH 2013-06-07 10:33:46
怎样隐藏PropertyGrid中的集合编辑器

我的集合定义如下:

public class ObjList<T> : CollectionBase, ICustomTypeDescriptor
{

}




谢谢!
...全文
126 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
benbenRH 2013-06-24
  • 打赏
  • 举报
回复
引用 1 楼 haha5di 的回复:
在你的类 集合 属性上加一个标签: [EditorAttribute(typeof(CustomUITypeEditor), typeof(System.Drawing.Design.UITypeEditor))] public List<T> T { get; set; } 新建一个类 CustomUITypeEditor: public class CustomUITypeEditor: System.Drawing.Design.UITypeEditor 重写 public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context){ return System.Drawing.Design.UITypeEditorEditStyle.None; }
谢谢你, 我把类改成结构体,它就消失掉了。。。
665 2013-06-19
  • 打赏
  • 举报
回复
在你的类 集合 属性上加一个标签: [EditorAttribute(typeof(CustomUITypeEditor), typeof(System.Drawing.Design.UITypeEditor))] public List<T> T { get; set; } 新建一个类 CustomUITypeEditor: public class CustomUITypeEditor: System.Drawing.Design.UITypeEditor 重写 public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context){ return System.Drawing.Design.UITypeEditorEditStyle.None; }

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧