I have Jordan Russel's Toolbar2000 toolbars that I create at runtime with an embedded TFrame and dock on the application main form. This frame has an embedded pane that in turn contains other panels and various controls. So the structure is:
TTBDock
TTBToolbar
TFrame (align=alNone, Autosize=true)
TPanel 1 (align=alNone, Autosize=true)
TPanel 2 (align=alTop ,Autosize = false)
TPanel 3 (align=alTop ,Autosize = false)
TPanel 4 (align=alTop , Autosize = false)
The idea is that panels 2, 3, 4 have their heights sized explicitly and the frame (and hence the toolbar) then resizes automatically to accommodate the new size.
It works fine except that the size of the toolbar is wrong the first time the toolbar is shown docked on the application main form. If I force a resize of the toolbar at that point (e.g. by explicitly resizing the TPanel heights again from a mouse click) it comes right. I've tried calling the routine to set the size twice, calling Update, Application.ProcessMessages, ReAlign - nothing seems to work except letting the main form paint and then performing the resize manually again.
If I break at the end of the resize routine and inspect the panel size and frame size, they are correct, but the toolbar size is not, so the first time it shows, the frame is partially shown in a wrong-sized toolbar. It comes right after another call to the sizing routine, but only after the main form has painted itself.
I could kludge up something nasty like explicitly resizing the panels after a timer expires but I'd rather solve the problem at it's source.
Any ideas as to why this might be happening (or not happening)?