Attached is a reduced version of the Open Page code
Start from the bottom of the page where I open a file and force it to tab position 0
I call open page, which calls add page which calls create dock. If all works OK the created dock panel back through the chain to the original calling routine.
How is it that the doc zone is initially valid but by the time it reaches the calling function its nil.
Looking at your code, I've realized that you loading files one by one (I've initially though that you want to load the whole docking layout). So, my first answer was wrong, and in this case you actually can specify tab position directly, without re-docking the panel second time.
Try to specify zero for ATabIndex parameter of the DockControl method directly in your CreateDock method, like:
//.... if zn <> nil then DsMain.DockControl(Result, zn, alClient, 0 {<- here}, SelectPage) else Result := nil; //...
Comments