Bring Parent to Front (on top of modaless child)

O

O.B.

I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?
 
B

Bjørn Brox

O.B. skrev:
I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?

Your button-click or whatever event that caused your parent form to open
the child form has not yet returned (i.e. your parent form is busy) and
cannot serve any more events.

If you want your parent form to continue operate independent of your
child form the child form has to be activated as a separate thread.
 
O

O.B.

O.B. skrev:


Your button-click or whatever event that caused your parent form to open
the child form has not yet returned (i.e. your parent form is busy) and
cannot serve any more events.

If you want your parent form to continue operate independent of your
child form the child form has to be activated as a separate thread.

As noted in the initial post, the child was opened with SHOW ... NOT
ShowDialog. Events in the Parent window are being handled just fine.
Try again ...
 
O

O.B.

As noted in the initial post, the child was opened with SHOW ... NOT
ShowDialog. Events in the Parent window are being handled just fine.
Try again ...

OK. Figured it out ... the trick is to not specify the Parent form as
the child's "Owner."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top