Properties/Enum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a property that takes a value from an enumerated type and is displayed in the properties window for a custom control. Any ideas how to go about this anyone?
 
Martin,

What you need to do is to help the property grid out a bit
on the way. You do this by provinding a TypeConverter to the
property and tell it to use the EnumConverter.

[TypeConverter(typeof(EnumConverter))]
public MyEnum PropName
{
// add get/set code
}

There are a wide range of converters you can use and you can
also derive your own converter for complex types.

HTH,

//Andreas
 
Back
Top