How to register TValueListEditor property editor for a TStrings property
Posted on 2011-05-02
I'm writing a component and I want a property to store key/value pairs.
I declared my member:
FProps : TStrings;
property Props: TStrings read FProps write SetProps;
procedure TMyComponent.SetProps(Value: TStrings);
I created in Create
FProps := TStringList.Create()
I free it in Destroy:
Now, after it is built and installed, if I drop it in a form and click on the Props property, I get a String List Editor.
I want a Value List Editor.
So, I'm trying to register the property editor:
RegisterPropertyEditor( TypeInfo(TStrings), TMyComponent, 'Props', TValueListEditor);
And I get the error:
E2010 Incompatible types: 'class of TBasePropertyEditor' and 'class of TValueListEditor'
I suppose it is a bit more complex than what I'm doing to get the ValueListEditor to edit my property....