Not tested and Win32 only:
If you know the top-most panel then use the above like this to move the new panel above the top one:
Extern "Win32" Function SetWindowPos(hwnd%,hWndInsertAfter%,x%,y%,w%,h%,wFlags%) End Extern Function ChangeGadgetOrder(src:TGadget,dst:TGadget,infront%=True) Const SWP_NOSIZE% = 1 Const SWP_NOMOVE% = 2 Local srcHwnd%=QueryGadget(src,QUERY_HWND) Local dstHwnd%=QueryGadget(dst,QUERY_HWND) If infront SetWindowPos dstHwnd,srcHwnd,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE Else SetWindowPos srcHwnd,dstHwnd,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE EndIf End Function
If you know the top-most panel then use the above like this to move the new panel above the top one:
ChangeGadgetOrder newpanel,toppanel