This is part of the main Windows control. A quick look at ComCtrls shows that changing TToolButton.Style calls the SetStyle method. If SetStyle , ShowCaptions is True, then TToolBar.ButtonWidth and ButtonHeight are 0, and ButtonHeight is called.
RecreateButtons , in turn, calls TToolBar.ResizeButtons , which simply sends (sends) a message to the ToolBar using
Perform(TB_AUTOSIZE, 0, 0);
TB_AUTOSIZE is for use in accordance with MSDN ,
after resizing the toolbar, either by setting the size of the button or bitmap, or by adding lines for the first time.
Since SetStyle sets both ButtonWidth and ButtonHeight to 0, this message will be sent correctly.
Ken white
source share