Re:Property Editor for Stringlist not working?
In article <01bcab69$55c01a20$b35c1bca@pat>
sy...@netlink.co.nz "Grant Berridge" writes:
Try the following:
Store the Property as TStrings.
In your create proc, Assign it a newly created TStringList: e.g.:
FStringProp := TStringList.Create;
In your published section define the property as having a write METHOD!
e.g.
published
property MyStrings : TStrings read FStringProp write SetStrings;
then write into your protected / private / public section:
Procedure SetStrings(Value : TStrings);
then the Procedure needs to be:
Procedure TMyDerivedComponent.SetStrings(Value : TStrings);
begin
FStringProp.Assign(Value);
end;
That should help.
If you need, I can dig up some component source.
If you have the VCL source, lookup components like TListBox or TMemo
Quote
> Last time I asked a question here, I got a huge response, all of which were
> helpful,
> so I thought I'd try my luck again.
> I've made a new component based on a TGroupBox, and I want it to have a
> TStringList property which the user can edit at design time. You set up a
> list of strings here, and those strings appear as TLabels inside the group
> box.
> I've done all the work to get the TLabels displayed if I programmatically
> build
> the TStringList, and when I install the component on my component palette,
> and place it on a new form, the TStringList property appears in the Object
> Inspector, with it's "..." icon at the end. But when you click on the
> Property
> Editor icon ("..."), it complains that it
> "Cannot assign a nil to a TRichEditStrings."
> I've looked all over the place in the help files and the manuals, and I've
> found
> out all sorts of exciting things, including how to write my own Property
> Editors,
> but none of them tell me how to actually use the existing ones. I thought
> it
> would be an automatic thing. Any suggestions?
> --
> Grant Berridge
> Analyst/Programmer
> Symantics Software Ltd ( sy...@netlink.co.nz )
--
Daniel Silverstone (Usually ;)
Look at the farstar Homepages on:
http://www.farstar.demon.co.uk/
Try out Daniel's TPascal Page & Delphi 2.0 bits at
http://www.farstar.demon.co.uk/Pascal/index.htm
Mail me & give comments (I know it's sparse ;)
mailto:WebMas...@farstar.demon.co.uk