Page 1 of 1

Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by Matt >> Mon, 30 Oct 2006 10:13:12 GMT

Anyone know how you can add gui objects to a frame under program control? If you can do it in Painter I presume you can do it in code but can't see how. Any pointers? Thanks.

Re: Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by allistar >> Mon, 30 Oct 2006 20:43:31 GMT

You can easily do it at runtime, but not at design time. You can modify persistent form data at design time, but not create them, short of automatically generating a ddb file and importing it. If you modify persistent form data at design time you need to ensure the effected form(s) is opened and saved in the painter (to ensure the binary that represents the form is regenerated).

Regards,
Allistar.

Re: Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by BeeJay >> Mon, 30 Oct 2006 20:47:27 GMT

Check out the online help for the following methods:

Control::loadControl - allows you to clone an existing control

Form::addControl - allows you to add a control you create programatically to the desired form.

To make the control a child of a given Frame, simply set the Control::parent propertly as appropriate.

Cheers,
BeeJay.

Re: Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by BeeJay >> Mon, 30 Oct 2006 20:50:02 GMT

Typo alert: propertly was meant to be property.

Re: Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by Matt >> Tue, 31 Oct 2006 0:15:58 GMT

Thanks, exactly the advice I needed!. Regards, Matt.

Re: Add gui objects to a frame programatically

Posted: Fri Aug 07, 2009 1:03 pm
by ConvertFromOldNGs
by Matt >> Tue, 31 Oct 2006 8:33:07 GMT

Thanks, exactly the advice I needed!. Regards, Matt.