There is a browser's demo Coolstuf in the Delphi CD. I found it strange question: Once you drag the Third Row Toolbar "Link] to the top, then drag back to the original location, then the toolbar will take over a blank area of approximately 40px. This obviously TCOOLBAR did not have a good package, I temporarily said that the problem is "toolbar misplaced".
I found that if there is a BAND to set FixedSize = true, it will have a deviation, and there is no problem with it. I guess may be that the height attribute of the BAN has not been truly updated after the toolbar is changed. (The details of the Rebar series control are still a lot, no wonder now Delphi does not add Chevron effect to the toolbar.) To solve this problem, just update the BAND set for fixedsize = true when receiving the RBN_HEIGHTCHANGE message. I.e. Anyway, just renewing an attribute, so there will be no side effects.
Specific method: find procedure tcoolbar.cnnotify (var message: twmNotify); replace the entire function to the following code.
procedure TCoolBar.CNNotify (var Message: TWMNotify); var I: Integer; RBBI: TReBarBandInfo; begin if (Message.NMHdr ^ .code = RBN_HEIGHTCHANGE) then if IsAutoSized and (ComponentState * [csLoading, csDestroying] = []) then begin // PATCH-BEGIN for I: = 0 to Bands.Count - 1 do if Bands [I] .FixedSize then begin FillChar (RBBI, SizeOfReBarBandInfo, 0); RBBI.cbSize: = SizeOfReBarBandInfo; RBBI.fMask: = RBBIM_STYLE; Perform (RB_GETBANDINFO, BANDS [i] .fid and idmask, integer (@rbbi)); Perform (RB_SetBandInfo, Bands [i] .fid and idmask, integer (@rbbi)); end; // patch-end recands; beginupdate; Try if AutoSize damdate; end; end; end; entry;
All right! Come. Copy the modified comCtrls.PAS to the CoolStuf directory and compile the file again. This problem disappeared.