【发布时间】:2013-07-24 20:29:16
【问题描述】:
我有两个自定义类:
class Something
{
}
和:
class SomethingElse
{
public Something newSomething {get;set;}
public String aName {get;set;}
public Image aPicture {get;set;}
//etc...
}
目前,当我在运行时选择class SomethingElse 时,它会填充我的PropertyGrid,向我显示我的所有属性及其相关交互。
即,它说“aPicture”的地方有一个 textbox 字段和一个 button [...] 我可以点击它,它会打开一个对话视图窗口来选择一个图像.
如何将此功能添加到我的自定义类中?因此,当 propertygrid 视图显示 newSomething 时,它会显示一个文本框和一个按钮?
我完全迷失了,甚至不知道我需要看什么/在哪里。
我查看了Image class,但在那里我看不到任何明显的东西。
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
您说“当我在运行时选择了SomethingElse 类时” - 不清楚您的意思是什么。你的意思是说“在运行时基于SomethingElse类创建一个对象”?
标签: c# image properties propertygrid