Board index » cppbuilder » Non-MDI child form/window

Non-MDI child form/window

Whats the best way to use forms as child windows (movable)
in a host container such as TScrollbox. (NOT  MDI  thanx)

I've tried the obvious approach :
    TMyForm * f = new TMyForm(this);
    f->Parent = ScrollBox;
    etc.

Problem is that controls (e.g. edit controls) on the child form ( i.e.
"f" above)
don't behave properly when you click on them (i.e. can't edit).

Any ideas.
Thanx in advance.

 

Re:Non-MDI child form/window


Quote
Rob wrote:

> Whats the best way to use forms as child windows (movable)
> in a host container such as TScrollbox. (NOT  MDI  thanx)

> I've tried the obvious approach :
>     TMyForm * f = new TMyForm(this);
>     f->Parent = ScrollBox;
>     etc.

The assignment of ScrollBox as a Parent is not allowed.
Although the movebility of the form is restricted to the
ScrollBox things go wrong as you found out.

You consider it an obvious approch and it could have been so
nice while changing the parent of a form it became like
a TPanel of that Parent, the titlebar vanisching.
With QT this is possible while everything is a Qwidget.

Borland later added TFrames to do the same with more overhead.
C++Builder 3 hasn't them. Version 5 has and about version
4 I don't know.

Hans.

Other Threads