I think it's better to derrive from TCustomForm instead TForm. TForm is VCL
compilled by Borland and you cannot change its DesignTime properties. But
you can create a new VCL based on a TCustomForm and add you own published
properties.

 

Jacek

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of ianhinson
Sent: Wednesday, April 25, 2007 11:07 AM
To: [email protected]
Subject: [delphi-en] Re: publishing properties

 

--- In [EMAIL PROTECTED] <mailto:delphi-en%40yahoogroups.com> ps.com,
"Katta Praveen \(UK\)" 
<[EMAIL PROTECTED]> wrote:
>
> Hi ian,
> 
> The property will appear in any form inherited from the form in 
which
> you have defined the property.
> 
> 
> 
> Regards,
> 
> Katta Praveen

Thanks. That was encouraging news.
However I did the following:
1) Created a form and named it TestForm.
2) Added a property to it as described in my earlier post. ie.
TTestForm = class(TForm)
private
{ Private declarations }
iTest: integer;
public
{ Public declarations }
published
property Test: integer read iTest write iTest default 0;
end;
3) Right-clicked on the form and selected Add To Repository..; Filled 
out the relevant details.
4) Created a new project & removed Form1 from it.
5) Did File->New->Other ..
6) Selected Forms | TestForm. Used option Inherit.

The new form created is indeed a descendant of TTestForm.

But still no "Test" property can be seen on it.

Regards,
Ian.

> 
> _____________________
> --- ianhinson <[EMAIL PROTECTED] <mailto:pparagon%40bigpond.net.au>
> net.au> wrote:
> 
> > If I add a property to a form like this:
> > 
> > type
> > TForm1 = class(TForm)
> > private
> > { Private declarations }
> > iTest: integer;
> > public
> > { Public declarations }
> > published
> > property Test: integer read iTest write iTest;
> > end;
> > 
> > The property Test does not appear in the Property
> > Inspector.
> > Why is that?
> > 
> > Ian.

 



[Non-text portions of this message have been removed]

Reply via email to