gpt4 book ai didi

c# - 如何更改 PropertyGrid 的默认 CollectionEditor?

转载 作者:太空宇宙 更新时间:2023-11-03 13:48:56 26 4
gpt4 key购买 nike

我在 WinForms 中使用 PropertyGrid。我可以更改默认的 CollectionEditor 吗?我可以通过 Editor 属性显示自定义 CollectionEditor,如下所示:

[Editor("MyProgram.CustomCollectionEditor , MyProgram, Version=1.0.0.0, Culture=neutral, PublicKeyToken=neutral", typeof(UITypeEditor))]

但我不想将它用于所有属性。

最佳答案

您可以在属性上使用 EditorAttribute,这样只有应用了该属性的属性才有自定义编辑器。

我认为How to: Take control over the Collection Editor's PropertyGrid可能对您要实现的目标有所帮助。

关于c# - 如何更改 PropertyGrid 的默认 CollectionEditor?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14319814/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com