【发布时间】:2010-11-03 10:46:20
【问题描述】:
我有一个 .net PropertyGrid。我选择要查看的对象,该对象的属性是 Vector3。我可以使用 ExpandableObjectConverter 自动将 Vector3 的属性公开到 PropertyGrid 中。一切都很好,除了选择对象时,我希望默认扩展 Vector3,即无需单击 [+] 即可查看 X、Y 和 Z。我该怎么做?
// Managed C++ :
[TypeConverter(ExpandableObjectConverter::typeid)]
public ref struct Vector3
{
Vector3(float _x, float _y, float _z)
: x(_x)
, y(_y)
, z(_z)
{}
float x, y, z;
property float X
{
float get() { return x; }
}
property float Y
{
float get() { return y; }
}
property float Z
{
float get() { return z; }
}
};
【问题讨论】:
-
在下面查看我的答案。它能为您提供帮助吗?如果是这样,请接受我的回答(并随时投票;)
标签: .net propertygrid