[DUG] Creating an object at run time.
Kyley Harris
kyleyharris at gmail.com
Fri Jul 13 16:32:22 NZST 2012
As Todd said. Also. If you are making custom controls make sure you use
registerclass to add them to the internal class list for lookup
On Friday, July 13, 2012, Todd Martin wrote:
> b := TComponentClass(FindClass('TButton')).Create(nil);
> propinfo := GetPropInfo(b.classinfo,'left');
> SetOrdProp(b,propinfo,100);
>
> > 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 <javascript:;>
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at listserver.123.net.nz<javascript:;>with Subject: unsubscribe
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz <javascript:;>
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz<javascript:;>with Subject: unsubscribe
>
--
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20120713/359f4a86/attachment.html
More information about the Delphi
mailing list