Embbeding Forms

Posted by GregHiggins on 05-Dec-2008 08:03

How does one embed one form inside another? Is it possible to make a form which resembles an ABL Frame, and then embed that Frame/Form inside another Frame/Form?

Some background: Prior to .Net Controls, if I wanted to build a UI, I'd have 1 persistent procedure for the Window, usually with an embedded frame. Then, suppose there were tabs, the tab frame would have its pp, each tab would have a frame with its own pp, and things like browses, button panels, input forms each would have their own pp.

Currently, When I start to build a window using the .Net forms, everything goes in 1 object. I have a startup procedure which is 10 times larger, by itself, than any of my former external procedures used to be. The functional cohesion is nil, if not negative.

All Replies

Posted by Matt Baker on 05-Dec-2008 08:17

Build yourself a (bunch of ) user control(s). The closest analogy is the ABL frame. You can't run it as a window itself, but you can put it inside any container, including windows, panels, other user controls... and so on.

To have a truly flexible UI you need to composite your objects. For instance you might create a user control for a map (like a control with a browser and a couple of search fields on it that shows only google maps) object which consists of a few things. You'd expose the data of the user control through properties or methods. Perhaps through a single object that represents the address as an object; or through multiple properties, one for each field. Depends on your needs. This is no different than dropping, say an ultragrid, onto a form, except that you wrote the object in its entirety in ABL.

Posted by Admin on 05-Dec-2008 08:24

Thanks for reminding us of the old times. I almost forgot.

Try using an UserControl in the Visual Designer.

Posted by GregHiggins on 07-Dec-2008 06:59

Do you think it's better to keep everything in one object?

Posted by Admin on 07-Dec-2008 11:04

Not at all!

That's why I create UserControls as logical grouped units of controls. To speak in the language of the old times: It's a bit like designing SmartObjects.

Posted by Thomas Mercer-Hursh on 07-Dec-2008 12:19

That might be an unfortunate comparison ...

Posted by Admin on 07-Dec-2008 13:01

I know - SmartObjects bring well functional (nowadays) base libraries with everything you need for data entry screens

For the UserControls it still requires someone to build these libraries using modern language/concepts/tools.

Do you know a better comparison?

Posted by GregHiggins on 08-Dec-2008 04:47

I've figured out why I missed this concept, the documentation buries it. Unlike hard copy, which I can read at leisure, excessive on-line text reading is tiresome. The UserControl concept was buried deep enough to avoid my initial scan.

One of these days I'm going to have to try out an ebook reader to see if that helps.

This thread is closed