Change of windows z-ordering during drag-and-dock operation

37 views Asked by At

I have three windows in my application named Form1, Form2 and Form3 (main form). Form2 can be docked into Form1. Corresponding properties are set as follows:

Form1->DockSite = true;

Form2->DragKind = dkDock; Form2->DragMode = dmAutomatic;

Form3->DockSite = false;

State of windows before starting drag-and-dock operations is displayed on screenshot1. State of windows after starting drag-and-dock operations is displayed on screenshot2. As you can see, immediately after starting drag operations, Form3 is moved into foreground. After moving Form2 over dockable area on Form1 gray rectangle appears on screen indicating docking place (even if this docking place is hidden under main form). After releasing left mouse button, Form2 is correctly docked into Form1 and main form goes again into background. How can I forbid main window (Form3) to move on top of Form1 during dragging process ? I have suspicion that this is related to TAdvDockPanel on top of main form. In practice I can't dock Form2 wherever into main form even if I want so I don't understand why the VCL moves main window into foreground when there is nothing to do ?

enter image description here

enter image description here

enter image description here

0

There are 0 answers