Add gui objects to a frame programatically

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

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.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

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.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

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.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

by BeeJay >> Mon, 30 Oct 2006 20:50:02 GMT

Typo alert: propertly was meant to be property.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

by Matt >> Tue, 31 Oct 2006 0:15:58 GMT

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

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Add gui objects to a frame programatically

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:03 pm

by Matt >> Tue, 31 Oct 2006 8:33:07 GMT

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


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 11 guests