Discussion:
Problem: Main form always under sub forms. (Sub forms always on top ?!?)
(too old to reply)
Skybuck Flying
2012-02-23 08:23:44 UTC
Permalink
Hello,

I have an application which creates a main form automatically as normal.

When a menu item is clicked a new sub form is created and shown. So it's
possible to create and show multiple sub forms.

Switching between the sub forms is possible by clicking on them and the sub
form that is clicked is on top.

However when trying to switch back to the main form while the sub forms are
still open the main form will remain behind the sub forms.

Clicking on the main form does not bring it on top ?!?

I tried BringToFront and SetFocus, this doesn't work, the main form remains
behind the sub forms ?!? (So the sub forms are always on top ?!?)

What is causing this behaviour ? Is this normal Microsoft Windows behaviour
? Or is this Windows 7 specific behaviour ? Or is this a Delphi/VCL-only
problem ?

It would be nice if the main form could be made to appear on top to
manipulate it's controls, so the subforms don’t have to be moved out of the
way...

Bye,
Skybuck.
n***@multidev.net
2012-09-21 18:36:45 UTC
Permalink
Post by Skybuck Flying
Hello,
I have an application which creates a main form automatically as normal.
When a menu item is clicked a new sub form is created and shown. So it's
possible to create and show multiple sub forms.
Switching between the sub forms is possible by clicking on them and the sub
form that is clicked is on top.
However when trying to switch back to the main form while the sub forms are
still open the main form will remain behind the sub forms.
Clicking on the main form does not bring it on top ?!?
I tried BringToFront and SetFocus, this doesn't work, the main form remains
behind the sub forms ?!? (So the sub forms are always on top ?!?)
What is causing this behaviour ? Is this normal Microsoft Windows behaviour
? Or is this Windows 7 specific behaviour ? Or is this a Delphi/VCL-only
problem ?
It would be nice if the main form could be made to appear on top to
manipulate it's controls, so the subforms don’t have to be moved out of the
way...
Bye,
Skybuck.
That will happen if the forms use the MDI or stayontop formstyle. An mdi child will always be presented in front of the parent form while a stayontop form will always stay on top of every form (except a newer stayontop form that would take its place). Try changing your forms FormStyle and see how it goes.
Loading...