[Solved] How to set TCoolBand heigth? lazarus / 31-LCL ---------------------------------------------------------------------- Edson · 2019-07-10 01:35 Normally I use ToolBar changing the buttons size and it works OK, but when using ToolBar in a TCoolBar (TCoolband), if I change the ToolBar height, the CoolBand doesn't change and there is not a height property to do it manually.  Maybe I'm doing something wrong with the CollBar. Suggestions? ---------------------------------------------------------------------- lucamar · 2019-07-10 11:49 Make sure AutoSize is True and FixedSize is False; TCoolBand should then adapt itself to the height of its contents. ---------------------------------------------------------------------- Edson · 2019-07-10 16:50 Quote from: lucamar on July 10, 2019, 01:49:43 pmMake sure AutoSize is True and FixedSize is False; TCoolBand should then adapt itself to the height of its contents. TCoolBand doesn't have "Autosize" property and Yes, FixedSize  is false. TCoolBar have "Autosize" but when set, it adapts to the TCoolBand height (wrong value), not the the ToolBar height. ---------------------------------------------------------------------- wp · 2019-07-10 17:22 I just tested this to use 32x32 icons in a toolbar inside a CoolBand: Add an image list. Set its Width and height to 32. Add 32x32 png images.Add a toolbar, assign the image list to its Images property. Set its AutoSize to true. The images are still larger than the spacie provided by the toolbar --> Set Toolbar.ButtonWidth and .ButtonHeight to something like 40.Add a TCoolbar, add a CoolBand. Assign the Toolbar to the CoolBand.Controls. Set The Coolbar's AutoSize to true ---------------------------------------------------------------------- Edson · 2019-07-10 22:19 Quote from: wp on July 10, 2019, 07:22:00 pmI just tested this to use 32x32 icons in a toolbar inside a CoolBand: Add an image list. Set its Width and height to 32. Add 32x32 png images.Add a toolbar, assign the image list to its Images property. Set its AutoSize to true. The images are still larger than the spacie provided by the toolbar --> Set Toolbar.ButtonWidth and .ButtonHeight to something like 40.Add a TCoolbar, add a CoolBand. Assign the Toolbar to the CoolBand.Controls. Set The Coolbar's AutoSize to true Good. This make the CoolBand take the height of the ToolBar. But if then you change the Toolbar height: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ToolBar1.ButtonHeight := 25; The CoolBand doesn't change the height.  But this give me an idea. If the Coolband adapt to the Toolbar height, when set. Then I have to do: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     ToolBar1.ButtonHeight := 25;  CoolBar1.Bands[0].Control := nil;  CoolBar1.Bands[0].Control := ToolBar1; Every time I want to change the height of the ToolBar.  And it works. I've the feeling this is not the normal behaviour for the Coolbar. ---------------------------------------------------------------------- wp · 2019-07-10 22:30 Quote from: Edson on July 11, 2019, 12:19:22 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ToolBar1.ButtonHeight := 25;//  CoolBar1.Bands[0].Control := nil;//  CoolBar1.Bands[0].Control := ToolBar1;  CoolBar1.AutoSizeBands;Try CoolBar1.AutoSizeBands instead of temporarily removing the Toolbar. ---------------------------------------------------------------------- Edson · 2019-07-10 22:48 Thanks. It does the trick. Now, my next step is how to know put two or more CoolBands in the same row, in design time or in code. ---------------------------------------------------------------------- wp · 2019-07-10 22:59 Set the 2nd CoolBand's Break to false. The Coolbar may become rather stubborn now, it's still better than Delphi's Coolbar, though; you must experiment with Coolband.MinWidth, Toolbar.AutoSize and maybe more. ---------------------------------------------------------------------- Edson · 2019-07-10 23:12 Property "Break" works OK. Would you know how to avoid the space after and before (and top) of the separator for CoolBands? I've been working with "GrabWidth" of the CoolBar but it have a bad behaviour. EDIT. Like usually, I've found it after post the question. It's "HorizontalSpacing".