TCheckBox.AutoSize doesn't work when changing caption in Runtime lazarus / 31-LCL ---------------------------------------------------------------------- Dibo · 2010-08-10 12:55 Hi, When I'm changing caption in Object Inspector then it work fine, but when I'm changing in runtime then it doesn't. CheckBox1.AdjustSize doesn't help. The only thing that comes to mind is CheckBox1.Width := Canvax.TextWidth(CheckBox1.Caption) but this give me only text size. How to get width of check button? Regards and sorry for my english. ---------------------------------------------------------------------- felipemdc · 2010-08-10 13:05 Which operating system, lazarus version, fpc version, etc? Did you try setting AutoSize to true? ---------------------------------------------------------------------- Dibo · 2010-08-10 13:17 Quote from: felipemdc on August 10, 2010, 03:05:50 pmDid you try setting AutoSize to true? Yes, I did. Sorry: Ubuntu 10.4 64bit (but I remember, I had this same problem on windows too) Lazarus 0.9.29 compiled from SVN source yeasterday (revision 27042 ? ), FPC 2.5.1 compiled from SVN source (revision 100802 ? ) ---------------------------------------------------------------------- felipemdc · 2010-08-10 13:38 Please create a new bug report and attach a test project ---------------------------------------------------------------------- Ocye · 2010-08-11 08:07 I fill a CheckListBox with data on runtime. Sometimes it happens that autosize doesn't work as you describe. But when I resize the formular it fits well. A workaround could be to call this method (or just to change size). ---------------------------------------------------------------------- Dibo · 2010-08-11 11:19 Sorry, very big mistake. CheckBox1.Autosize works well, but CheckBox1.Width return wrong number. I have not seen it before, because other components were dependent of CheckBox1.Width, so they just cover CheckBox1. Someone had this same problem, but it has not been resolved: http://www.lazarus.freepascal.org/index.php/topic,4343.0.html Anyone have idea how to "refresh" width of CheckBox? ---------------------------------------------------------------------- felipemdc · 2010-08-11 12:37 Gtk2 or Qt? Is the issue already in the bug tracker? ---------------------------------------------------------------------- Dibo · 2010-08-11 14:21 GTK2. I will post this bug. Thanks.