[DUG] Creating an object at run time.

Kyley Harris Kyley at harrissoftware.com
Fri Jul 13 19:55:54 NZST 2012


Just guessing, but the fact that he wants to dynamically create them at
runtime by "name" rather than explicit TButton.create implies a dynamic
nature of design where the classes wont be
known at design time.. ie Form Builder.

On Fri, Jul 13, 2012 at 7:34 PM, russell <russell at belding.co.nz> wrote:

> Are there reasons you would avoid making the objects at development time as
> not visible and making them visible only when needed?
> Stated without negatives, make the objects now, make them invisible and
> when
> needed make them visible.
>
>
> -----Original Message-----
> From: delphi-bounces at listserver.123.net.nz
> [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of David O'Brien
> Sent: Friday, 13 July 2012 3:21 p.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: [DUG] Creating an object at run time.
>
> I want to create an object at runtime given a string with the object type.
> Is this possible or do I need to do a whole pile of if then else's? There
> is
> a limited number of different objects that need to be created. I then want
> to access the created objects properties by name and assign methods.
>
> This is not for oleobjects, but VCL controls.
>
> i.e.
> b := CreateObject('TButton') ;
> b.GetField('left') := 100 ;
> ...
>
> Help on any of these would be appreciated.
>
> Cheers,
> Dave.
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>



-- 
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20120713/936dcc24/attachment.html 


More information about the Delphi mailing list