R
Richy
Hi,
I have a class that exposes the Microsoft.DirectX.Direct3D.Compare
property, which allows a drop-down list of values (such as Never,
Always etc) to be selected via the propertygrid. I write the string
value ("Never", "Always" etc) to an XML file, and when I read back the
XML file and set the property I want to be able to set it via the
string. This is my property:
<TypeConverter(GetType(Microsoft.DirectX.Direct3D.Compare))> _
Public Property AlphaFunction() As
Microsoft.DirectX.Direct3D.Compare
Get
Return _properties(PropertiesList.AlphaFunction)
End Get
Set(ByVal value As Microsoft.DirectX.Direct3D.Compare)
_properties(PropertiesList.AlphaFunction) = value
End Set
End Property
What do I need to do to be able to set this property via it's string
value, but still return a drop-down list within a propertygrid to allow
the value to be selected by its name? e.g.
myclass.AlphaFunction = "Never"
Thanks,
Richy
I have a class that exposes the Microsoft.DirectX.Direct3D.Compare
property, which allows a drop-down list of values (such as Never,
Always etc) to be selected via the propertygrid. I write the string
value ("Never", "Always" etc) to an XML file, and when I read back the
XML file and set the property I want to be able to set it via the
string. This is my property:
<TypeConverter(GetType(Microsoft.DirectX.Direct3D.Compare))> _
Public Property AlphaFunction() As
Microsoft.DirectX.Direct3D.Compare
Get
Return _properties(PropertiesList.AlphaFunction)
End Get
Set(ByVal value As Microsoft.DirectX.Direct3D.Compare)
_properties(PropertiesList.AlphaFunction) = value
End Set
End Property
What do I need to do to be able to set this property via it's string
value, but still return a drop-down list within a propertygrid to allow
the value to be selected by its name? e.g.
myclass.AlphaFunction = "Never"
Thanks,
Richy