Board index » delphi » Child forms to Stay within Parent

Child forms to Stay within Parent

Quote
>>Is there any way to 'keep' these child forms inside the parent form?

You can use MDI.

See the example in:    C:\Program Files\Borland\Delphi5\Demos\Doc\TextEdit

=Bill

 

Re:Child forms to Stay within Parent


Hi,
  I've a form with many sub (child) forms of style bsDialog (meaning only
close button on the top right corner). I execute these forms using
Application.Show. However these forms would often lose focus and hid behind
the other windows. Is there any way to 'keep' these child forms inside the
parent form?

Thanks,
  clifford.

Re:Child forms to Stay within Parent


Did you set the parent property to the parent form?

Re:Child forms to Stay within Parent


Quote
In article <39e67e28_1@dnews>, CLiffordiL wrote:
>   I've a form with many sub (child) forms of style bsDialog (meaning only
> close button on the top right corner). I execute these forms using
> Application.Show. However these forms would often lose focus and hid behind
> the other windows. Is there any way to 'keep' these child forms inside the
> parent form?

clifford,

you can try to override the CreateParams method for these childforms, call
inherited first and then set

  param.wndParent := Application.Mainform.handle;

(or if the "parent" in question is not your main form, use its handle).  

Quote

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Child forms to Stay within Parent


Thanks people,
  I tried your methods, but I think MDI's more appropriate in my case.

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> wrote in message
news:VA.00005fb4.007fdba9@antispam.compuserve.com...

Quote
> In article <39e67e28_1@dnews>, CLiffordiL wrote:
> >   I've a form with many sub (child) forms of style bsDialog (meaning
only
> > close button on the top right corner). I execute these forms using
> > Application.Show. However these forms would often lose focus and hid
behind
> > the other windows. Is there any way to 'keep' these child forms inside
the
> > parent form?

> clifford,

> you can try to override the CreateParams method for these childforms, call
> inherited first and then set

>   param.wndParent := Application.Mainform.handle;

> (or if the "parent" in question is not your main form, use its handle).

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!

Other Threads