How to size a csSimple ComboBox at design time.? lazarus / 31-LCL ---------------------------------------------------------------------- jamie · 2020-05-21 18:41 Recently working with the CustomCombo box I have experience some issues with sizing the box on the form while the style := csSimple in designer state (IDE editing)   At first I thought it was me with the code I was doing which is inherited from a CustomCombobox but then the designer started allowing it to be sizeable on the form for no apparent reason.  As some may not know with csSimple, its a fixed drop down so you need to size the drop down by dragging it with the gripping square at design time or runtime..  I tried with the latest release 2.0.8 and it does not work there either.  This seems to be random because it will work depending on what the day of the week is or if its rainy outside, at least that is what it appears... Drop a Tcombobox on the form,. set the style := csSimple, put some items in it, and then tried to size the height of it to force the dropdown to show via mouse operation.  Can someone shed some light on the subject ? ---------------------------------------------------------------------- wp · 2020-05-21 20:08 I think you are misunderstanding the csSimple combobox style. csSimple results only in an edit box where you can type some text. There is no dropdown at all. The items exist only in the background, and you can use the UP/DOWN arrow key to navigate through the items and bring the currently selected item into the edit box. By no means you can increase the height of the edit box to show the dropdown as if it were a Listbox. ---------------------------------------------------------------------- jamie · 2020-05-21 20:24 absolutely not true.. it is suppose to drag down and show the list box as a static box at design time. It has worked randomly and it works at run time .. There is a problem at design time and its random. Please populate the list and at run time change the height and you will see that it shows a static list box that you can travers on or even select from...  My old Delphi behaves correctly ., it Sizes the box at design time and shows it as sized at runtime. it works as documented.   It did work one day while I was working on some code, the IDE sized it with no issues, today I can not get it to work.  I have tried with 3 different versions of Lazarus including the current release version and today they refuse to size. The other day they worked correctly.  In Delphi 10. it sizes on the form while  you work on it but it shows an issue at runtime so I am not counting that for the time being.. https://docs.microsoft.com/en-us/windows/win32/controls/about-combo- boxes ---------------------------------------------------------------------- wp · 2020-05-21 21:17 OK, I've never seen it like that, but I tried with Delphi and it works like you describe. Why don't you combine a TEdit and a TListbox? ---------------------------------------------------------------------- jamie · 2020-05-21 23:45 over fixing it?  I am trying to correct an already failed component that inherits from the Tcombobox and one of the active modes is the csSimple..  I file a bug report because this is an error and it does work sometimes in the designer, there is something strange happening.. ---------------------------------------------------------------------- jamie · 2020-05-22 01:51 While playing with this, dropping the list at runtime I've also found another issue, the size of the window is longer than the actual list at times, depending of the overall size of the window.  For example I have 4 items in the list, I need to set the height of the ComboBox to 87 so that the list will be fully viewed without any scrollbar.  If the drop down is not at the correct multiple value the window for the control is actually taller than the list.. so what happens is if you size your form to cover this control then enlarge the form to make it show there is a black band at the bottom of the list because it belongs to the Combobo but never gets painted.     If you implement the OnMouseDown event and place a test beep in there, you can click on this black band and it receives messages. so it is part of the combobox but the list it self is not fully covering it.  I've also seen this with the other styles of the combobox, the list has a background more than the list itself.. it causes exclusions on the parent control.  Just drop a combo on the form, set it to csSimple, and place a button on the form so that you can size the box tall at runtime, you'll see the box listed .. Now shrink the form to cover the list box and then expand the form to reshow the list box. You should now see the blank band at the bottom of the list box...  Experimenting with the Height property I can find the correct multiple that fixes it. but I should not need to do this and since this is also effecting the other styles of combobox I think this issue needs to be addressed. ---------------------------------------------------------------------- jamie · 2020-05-22 12:15 I am telling you guys, this issue with the abilitiy of dragging the CSSimple box open on the form is on a timer, date or there is some junk variable flooding around in the environment dealing with the this control  Because this morning I start Lazarus, grab the grippers on the csSimple combo box and it works, I can now size it from the Designer..   you tell me? uninitialized variables or what ?     Today its a good day outside so it can't be rainy weather so maybe it's Friday for me and that is the day it works... Who knows, it behaves like its on a schedule, its own and not mine..! ---------------------------------------------------------------------- winni · 2020-05-22 13:40 Hi! Works only if Odd(DayOfTheWeek(now)) = true Winni ---------------------------------------------------------------------- jamie · 2020-05-22 14:20 LOL, really... I started laz on one of my other PC's and that one still fails to control the size of the csSimple at design time so I can discount dates   I guess its time to file a report because also the issue with what appears to be a parent window hosting the OS combo box which is taller than the OS combobox, and this is allowing GUI space on the screen that does not get painted after you cover it up and reshow it. ---------------------------------------------------------------------- jamie · 2020-05-23 14:16 I was able to get the csSimple to work without the unpainted garbage at the bottom of the list but it appears the be OS specific..   Windows at some point is putting the list into "Integral-Size" mode, meaning it will not partially show an item at the end if the user has the list box not set at the correct multiple size.  To fix this issue I added CBS_NOINTEGRALHEIGHT to the Style property as I override the CreateParms method to do so..     I haven't done  this generally to the over all Combobox code but just to the TComboBoxEx for csSimple mode and it works. It paints correctly and I am sure when I recompile the IDE it will also size in the IDE..  btw, Today is Friday, I started Lazarus, and guess what? I can't size the csSimple combobox in the IDE..  I guess I can add this find to the Bug report at the Bug reporting center ---------------------------------------------------------------------- wp · 2020-05-23 15:42 BTW, is AutoSize turned off on every mysterious day? ---------------------------------------------------------------------- jamie · 2020-05-23 16:28 LOL, I've tried all of that .. its dicey. It works when it wants to and when it does it will work until I reload Lazarus..  There has to been sloppy variable in there for that case..  I recompiled the IDE with the changes I made to the TComboEx just to see if the sizing was corrected but it is not. Although the TcomboboxEx works with no garbage at the bottom I still can not size it in the designer..   I need to look deeper to see why that is taking place.  as for the CBS_NOINTREGALHEIGHT options, I think that is best setting that only for csSimple mode comboboxes.. otherwise it will effect the dropdown listings too. EDIT:  I just tried the sizing again and now all my test combo's in csSimple are sizing...  there is some scrap variable running around. ---------------------------------------------------------------------- jamie · 2020-05-23 16:51 I figured out the sizing issue.. it is a problem in the IDE designer and I can make It work .. Create a simple app.  Drop a Tcombobox on it...  Set the Style to csSimple  you won't be able to size it at this time.  Save the project and close it..  Reload the project. the Style settings is still csSimple, don't change it..  Now you can resize it.  This has something to do with getting the properties read in at load time but at design time its being rejected.. ---------------------------------------------------------------------- jamie · 2020-05-23 23:05 I come up with a proper fix for the unpainted areas for the csSimple combobox.. I have it so it's only acting on a csSimple… For now, Open your "CustomComboBox.inc" file in the Lazarus source files at the "CreateParams" method add this at the bottom.. 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 {$IFDEF Windows}  if (Params.Style and CBS_SIMPLE)<>0 Then Include(FWinControlFlags, wcfEraseBackground) Else   Exclude(FWinControlFlags, wcfEraseBackground); {$IFEND}                                           Compile, this will rebuild your LCL files... you can experiment on a test form.. if you like it you can then rebuild your IDE... ---------------------------------------------------------------------- jamie · 2020-05-24 01:07 had to add a little to that last one, it seems windows does not properly draw its highlighted box around it, it maybe its in the LCL and I haven't yet found that ? but in any case, this code will fix that for the time being.. 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  {$IFDEF Windows}  if (Params.Style and CBS_SIMPLE)<>0 Then   Begin    Include(FWinControlFlags, wcfEraseBackground);    Params.Style:= Params.Style or $400; //CBS_NOINTEGRALHEIGHT   End  Else   Exclude(FWinControlFlags, wcfEraseBackground); {$IFEND}                                             Put that in the CustomComBoBox.CreateParams…. in the CustomCombobox.inc file.. place it at the bottom.  Of course If you want broken down csSimple combo boxes you can keep it as is ---------------------------------------------------------------------- J-23 · 2020-05-24 13:10 Quote from: jamie on May 24, 2020, 03:07:58 amhad to add a little to that last one, it seems windows does not properly draw its highlighted box around it, it maybe its in the LCL and I haven't yet found that ? but in any case, this code will fix that for the time being.. 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  {$IFDEF Windows}  if (Params.Style and CBS_SIMPLE)<>0 Then   Begin    Include(FWinControlFlags, wcfEraseBackground);    Params.Style:= Params.Style or $400; //CBS_NOINTEGRALHEIGHT   End  Else   Exclude(FWinControlFlags, wcfEraseBackground); {$IFEND}                                             Put that in the CustomComBoBox.CreateParams…. in the CustomCombobox.inc file.. place it at the bottom.  Of course If you want broken down csSimple combo boxes you can keep it as is Maybe it would be worth adding it to the Tracker bug - then over time it would end up in official sources ---------------------------------------------------------------------- jamie · 2020-05-24 14:09 I tried to setup the snv patching system on my PC before but it ended in a total mess on my side. I did report that code on the bug tracker but they are too busy putting out fires with the snv version. I've patched the LCL code in several places and made a folder with all the updates and notes so when and if I down load the latest release I check and merge the fixes I have into it.  Putting out fires tend to be a hard job when there are too many arsonist and not enough fire fighters to go around. ---------------------------------------------------------------------- wp · 2020-05-24 17:36 Quote from: jamie on May 24, 2020, 03:07:58 amhad to add a little to that last one, it seems windows does not properly draw its highlighted box around it, it maybe its in the LCL and I haven't yet found that ? but in any case, this code will fix that for the time being.. 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  {$IFDEF Windows}  if (Params.Style and CBS_SIMPLE)<>0 Then   Begin    Include(FWinControlFlags, wcfEraseBackground);    Params.Style:= Params.Style or $400; //CBS_NOINTEGRALHEIGHT   End  Else   Exclude(FWinControlFlags, wcfEraseBackground); {$IFEND}                                             Put that in the CustomComBoBox.CreateParams…. in the CustomCombobox.inc file.. place it at the bottom. I think in order to get this accepted in the bug tracker you must put this code into the win32 widgetset, not in TCustomCombobox.CreateParams. The inventors of the LCL provided the widgetset architecture to keep the outermost units free from lots of IFDEFs like this. The TCombobox is implemented in unit StdCtrls, therefore you should  put your code into Win32WSStdCtrls.pp which resides in folder lcl/interfaces/win32 of your Lazarus installation. There is a class function TWin32WSCustomCombobox.CreateHandle which seems to be suitable for you code (I did not try it integrate it, though). Probably the same modification should be make with the corresponding file for the WinCE widgetset (in folder lcl/interfaces/wince). ---------------------------------------------------------------------- jamie · 2020-05-24 21:33 Quote from: wp on May 24, 2020, 07:36:40 pmQuote from: jamie on May 24, 2020, 03:07:58 amhad to add a little to that last one, it seems windows does not properly draw its highlighted box around it, it maybe its in the LCL and I haven't yet found that ? but in any case, this code will fix that for the time being.. 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  {$IFDEF Windows}  if (Params.Style and CBS_SIMPLE)<>0 Then   Begin    Include(FWinControlFlags, wcfEraseBackground);    Params.Style:= Params.Style or $400; //CBS_NOINTEGRALHEIGHT   End  Else   Exclude(FWinControlFlags, wcfEraseBackground); {$IFEND}                                             Put that in the CustomComBoBox.CreateParams…. in the CustomCombobox.inc file.. place it at the bottom. I think in order to get this accepted in the bug tracker you must put this code into the win32 widgetset, not in TCustomCombobox.CreateParams. The inventors of the LCL provided the widgetset architecture to keep the outermost units free from lots of IFDEFs like this. The TCombobox is implemented in unit StdCtrls, therefore you should  put your code into Win32WSStdCtrls.pp which resides in folder lcl/interfaces/win32 of your Lazarus installation. There is a class function TWin32WSCustomCombobox.CreateHandle which seems to be suitable for you code (I did not try it integrate it, though). Probably the same modification should be make with the corresponding file for the WinCE widgetset (in folder lcl/interfaces/wince). Ok, I can do that and see what happens... I think I attempted to do it that way before but it seems no matter what I was doing in that createhandle it appeared to be taking no effect on the final end..  Its like the compile was still linking in the old Object code.  But I can try again.. ---------------------------------------------------------------------- jamie · 2020-05-24 22:29 @WP  I can't get access to the fWinControlFlags in the Win32WSStdCtrls in the CreateHandle..  but I was able to put the CBS_NOINTEGRALHEIGHT settings there.  I only put a conditional statement here because I wasn't sure what gk2, qt would do with the CBS- additions to the Style .. However, all other stuff is in the TWinControl which is the same across the board..  So maybe I can just take the conditional compile out. 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   end;  // create window   If (CBS_SIMPLE and Params.flags)<>0 Then   { <<<< Added jp}   Params.Flags := Params.Flags or CBS_NOINTEGRALHEIGHT; {<<<< Added}   FinishCreateWindow(AWinControl, Params, False, True);  Info.cbSize := SizeOf(Info);  Win32Extra.GetComboBoxInfo(Params.Window, @Info);                 I can not get access to the FwincontrolFlags in there. have any ideas ? ---------------------------------------------------------------------- wp · 2020-05-24 23:10 Hmm... FWinControlFlags is protected in TWinControl. The WinControl affected is passed as a parameter to CreateHandle. Can you try the usual (ugly) type-cast hack? 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 type  TWinControlAccess = class(TWinControl);...  Include(TWinControlAccess(AWinControl).FWinControlFlags, wcfEraseBackground); The other widgetsets will not see any modification here. ---------------------------------------------------------------------- jamie · 2020-05-25 00:38 class function TWin32WSCustomComboBox.CreateHandle(const AWinControl: TWinControl;  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  end;  // create window   If (CBS_SIMPLE and Params.flags)<>0 Then   {Added jp csSimple comboboxes don't paint correctly otherwise.}  begin   Params.Flags := Params.Flags or CBS_NOINTEGRALHEIGHT;   Include(TWinControlAccess(AWinControl).FWinControlFlags, wcfEraseBackground);  end Else   Exclude(TWinControlAccess(AWinControl).FWinControlFlags, wcfEraseBackground);{Added jp}   FinishCreateWindow(AWinControl, Params, False, True);                                   Done Apparently there is already a class in there just for that purpose... its strange you just happen to know about that one I removed all the added stuff in the CreateParams… its all here now... now how to submit.. ---------------------------------------------------------------------- wp · 2020-05-25 09:54 I added your code to the TWin32WSCustomCalendar.CreateHandle function of my local installation, and I see that it mostly solves the drawing issue due to the integral lineheight. However, there are issues left: - When the bottom edge of the combobox is anchored to the bottom edge of the form the height of the combobox changes with the form. However, the bottom border line of the listbox is painted only for specific heights, in particular when the height is reduced. (see screenshot) - When the height of the combobox is changed in an OnClick event of a button then it is not sufficient to simply apply a value to Combobox1.Height, it is also required to call Combobox1.Invalidate explicitly. Otherwise the listbox will be painted only partly. - It is still not possible to see the listbox when the combobox height is changed at designtime (even when AutoSize is false). ---------------------------------------------------------------------- jamie · 2020-05-25 10:42 I have seen the bottom edge issue that you have described but only in my Windows 10 PRO, my Home edition of Windows 10 does not show that missing border line..  I have also had others test it and it varies depending on the OS they are on, for example Win7 seems to work perfectly.  When testing the height property values between the OS drawing its own list box verses the window that is created in the LCL as the parent window, there is 1 pixel difference in size. It looks like a rounding mismatch. One rounds up while the other trunks it.  As for the invalidate issue. I'll see if I can do something about that. That is another one that does not happen on all of my WIn10 PC's    As for not being able to size the box initially when selecting the csSimple, I have concluded that is a bug in the IDE OI. Unrelated to this issue..  If you drop a combobox on the form, set the style := csSimple, you can not size it. Save your project, reload the project and now you can size it..   its being blocked some how because it is accepted if you reload your project with the property preset. ---------------------------------------------------------------------- wp · 2020-05-25 11:55 Quote from: jamie on May 25, 2020, 12:42:41 pmI have seen the bottom edge issue that you have described but only in my Windows 10 PRO, my Home edition of Windows 10 does not show that missing border line.. Mysterious: I have Win10 Home, too. Quote from: jamie on May 25, 2020, 12:42:41 pmIf you drop a combobox on the form, set the style := csSimple, you can not size it. Save your project, reload the project and now you can size it..Yes indeed. However, it does not resize smoothly, but in steps as if some kind of IntegralHeight would still be active. BTW, there are three checks agains csSimple in win32wsstdctrls.pp. Are they really required? I have the feeling that the csSimple style was implemented with the understanding that the listbox should not appear (as was my initial opinion). ---------------------------------------------------------------------- jamie · 2020-05-25 13:29 The designer most likely is causing the steps because its trying to stay with the grid on the form. and yes I have seen the multiple hits in there blocking the csSimple but I think some of those checks are for the drop down mode.  Currently the only issue I am seeing is the parent window isn't getting a repaint after changing the size in code land without the Invalidate. This reminds me of the old days where it was common to call invalidate always when changing sizes. but the issue here is it appears to be getting late drawing action because I can move my mouse over it and then it completes the draw.  I am still looking for that ester egg ---------------------------------------------------------------------- jamie · 2020-05-26 00:05 I've been working at this for a while now and finally came up with something... You can not send a invalidate during any of the comment events that take place while the control is being sized, setup etc....  Windows blocks a lot of control messages while doing panting and other jobs but I did comeup with the solution...  I added a message trap in the Message Handler for WM_SIZE, at that point I then issue a InvalidateRect call which then caches up WM_ERASEBKGND and WM_PAINT messages that come later.  In this message handler Finction.. 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 function ComboBoxWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;  LParam: Windows.LParam): LResult; stdcall;                                   Add this.. 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      end;  WM_SIZE:       begin          WindowInfo := GetWin32WindowInfo(Window);         If TCustomcombobox(WindowInfo^.WinControl).Style = csSimple Then         InvalidateRect(Window,Nil,true);       end;                                     My other code, the last revision still remains in place, it needs to be there to fix those little items I originally found..  This adding of the Message handler fixes the problem of sizing the box via code... etc..  Let me know what you need.... please. ---------------------------------------------------------------------- wp · 2020-05-26 23:03 Yes, this fixes the missing bottom line. What's left, in my opinon, is the missing redraw after height changes by code, and the object inspector issue. I do not believe that this a bug of the OI, but a misplaced "(csDesigning in Component)" somewhere. ---------------------------------------------------------------------- jamie · 2020-05-27 11:09 The added message I showed you fixes the redraw when height changed by code.. Did you put that in the message loop? Also I commented those sections that were testing for the csSimple as you pointed out.. and I made a change to the one of them because while in the designer mode it mess up the designer when trying to drag to a new position, the cursor gets off track for that control.. 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 class procedure TWin32WSCustomComboBox.AdaptBounds(const AWinControl: TWinControl;  var Left, Top, Width, Height: integer; var SuppressMove: boolean);var  StringList: TWin32ComboBoxStringList;begin  {if TCustomComboBox(AWinControl).Style = csSimple Then Exit;}  StringList := GetStringList(TCustomComboBox(AWinControl));  if Assigned(StringList) then    Height := StringList.ComboHeight;end;                                   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 class procedure TWin32WSCustomComboBox.GetPreferredSize(  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;  WithThemeSpace: Boolean);begin  PreferredHeight := 0;  if (AWinControl.HandleAllocated)and  (Not(csDesigning in AWinControl.ComponentState)or(TCustomComboBox(AWinControl).Style <> csSimple)) then  { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ADDED}    PreferredHeight := AWinControl.Height;end;                                                             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  class function TWin32WSCustomComboBox.GetStringList(  const ACustomComboBox: TCustomComboBox): TWin32ComboBoxStringList;begin  Result := nil; { if ACustomComboBox.Style <> csSimple then}    Result := TWin32ComboBoxStr ingList(GetWin32WindowInfo(ACustomComboBox.Handle)^.List);end;                                                                                   I found that I had to uncomment those events to make things smoother for one of my PC's where as the other it didn't matter.. Btw, on my Win PRO 10 PC, I still have a 1 pixel calculation error at the base of the box while in Themes mode only. So I think the issue here is in the Themes drawing doing the calculations..  The only other differences between the two pcs is version numbers of Lazarus.. WinPRO = 2.0.8 where as Home edition PC has 2.0.6 on it.. 64 bit for both.  I have looked high and low, I can not find any reference in the Widget code or CustomCombo code that is causing the IDE issue.. If you would like I can forward you my copy of this complete widget file if you wish ? ---------------------------------------------------------------------- wp · 2020-05-27 11:57 Quote from: jamie on May 27, 2020, 01:09:03 pmIf you would like I can forward you my copy of this complete widget file if you wish ? Yes please, I just was wanting to ask for it to make sure that I've got everything. Then I'll apply it to trunk. I also assigned your bug report to myself. On which Laz version will the modified file be based? A tiny annoyance (besides the object inspector) is left: The AutoSize property is not working as I would expect, depending on what AutoSize is supposed to do. Well, when I change the font height and AutoSize is active, the combobox height increases, that's fine. But once it is possible to modify the height of the csSimple box with AutoSize=false it is possible to decrease the height of the control such that it becomes less than the height of the edit box. When I activate AutoSize now I would expect that the height jumps back to the height of the default edit box. ---------------------------------------------------------------------- wp · 2020-05-27 14:07 AutoSize usually gets the "autosize" values from GetPreferredSize, and when I borrow code from TWin32WSCustomEdit the AutoSize described in the previous post works this way: 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 class procedure TWin32WSCustomComboBox.GetPreferredSize(  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;  WithThemeSpace: Boolean);begin  PreferredHeight := 0;  if (AWinControl.HandleAllocated) then  begin    if MeasureText(AWinControl, 'Fj', PreferredWidth, PreferredHeight) then  begin      PreferredWidth := 0;      Inc(PreferredHeight, 8);    end;  end;end;  I am a bit in doubt though because I do not understand why the old combobox AutoSize worked at all. ---------------------------------------------------------------------- jamie · 2020-05-27 17:31 That last one totally destroyed it ! it shrunk the box down to the size of a normal EDIT box..  As talk about before... I uncommented(unblocked) the areas where csSimple was being ignored. And the GetPreferred Size I have it the way I posted here.. Let me see if I can figure out how to send this to you via mail ---------------------------------------------------------------------- jamie · 2020-05-27 17:38 Seems I can't sent it to you via this network with a message because it exceeds the size.. I think you have my personal email , send me a mail and I will reply back or if you want I can drop it here ? ---------------------------------------------------------------------- wp · 2020-05-27 21:38 I don't understand: win32wsstdctrls.pp is only 73 kB, and when you zip it it will be even smaller. ---------------------------------------------------------------------- jamie · 2020-05-27 22:56 I guess you didn't understand..  Attempted to message you via this forum but It was too large of a file for that..  Do you want me to drop it here  for public consumption, that is my question ? ---------------------------------------------------------------------- wp · 2020-05-28 11:01 Now you completely lost me. I am interested in the win32wsstdctrls.pp file with your changes to make the csSimple style work as discussed in this thread. A zipped version is only a few kB which nicely fits into the upload limit. And the file is available to every Lazarus user. So why shouldn't it be wrong "to drop it for public consumption"? If you think that the forum is not the right place - yes, probably, it should be an attachment of your bugtracker report, where - by the way - the entire discussion of this topic should have occured. Normally only diff files should be submitted to bugtracker so that the reviewer can see what has been changed. But if you tell me on which Lazarus version the full file is based I can find out the diffs myself. ---------------------------------------------------------------------- jamie · 2020-05-28 13:21 This file is from my 2.0.4 cut.. The other PC is not near me atm but that has 2.0.8 and the file seems to be the same so there is no different that I can see.  If you really want that file I can get It for you but I think this is enough.. ---------------------------------------------------------------------- wp · 2020-05-28 15:35 Thanks. I created a patch from the differences to the trunk file and uploaded it to the bugtracker report. I also uploaded a demo. It shows me that the repaint issue after setting the csSimple combobox height by code is not yet solved. While I normally use trunk I played with the demo with Laz 2.08 to have an unmodified system and to see the original painting bug again. Are you sure that disabling the integral height feature of the listbox really is the solution? I get the feeing that it simply hides the original repainting issue of the stationary listbox. Wouldn't it be better to find the handle of the stationary listbox and send a redraw message (or similar, of course)? Did you ever play with the handle of that listbox? I think it is accessible via the TComboboxInfo (TComboboxInfo.hwndList) - see ComboboxWndProc():  Win32Extra.GetComboBoxInfo(Window, @Info) Another rather elemental problem: I don't know about the strategy what the LCL does with a control that has extended possibilities in one widgetset compared to others. Does it implement the full feature set in that widgetset and leave the fissing feature unimplemented in the others? Or does it implement only the "common denominator", i.e. only what is common to all, so that the control behaves the same in all widgetsets? I think I'll have to ask the other developers about it. ---------------------------------------------------------------------- jamie · 2020-05-28 16:04 I will look at it again, I don't know why you still see this drawing after the changes. With the old 2.0.4 on WIn10 home it look perfect. with the Pro10 there is an initial problem where the themes isn't drawing the border properly but its one of those things that once you size it or even change the size of it using the modified code I then see the border..  I could be wrong but I believe the handle (WIndow) is the handle to the actual combobox control in windows because if I use that handle to send messages to the combobox directly it response … I'll Look a little deeper.. maybe I missed something... 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       end;    WM_SIZE: {JP added for csSimple border painting with the list in view}       begin          WindowInfo := GetWin32WindowInfo(Window);       If TCustomcombobox(WindowInfo^.WinControl).Style = csSimple Then         Begin          InvalidateRect(Window,Nil,true);         end;       end; {/jp}              Did you put that change in the Message handler ? ---------------------------------------------------------------------- jamie · 2020-05-28 17:29 The "GetPreferredSize" Needs to be put back to the original state.. What is happening it I get a limited amount of Height resizes at runtime, after which changing the height values do not change anything in the control, in otherwords you can't resize the controls at runtime after about 50 or more Height changes.. 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 class procedure TWin32WSCustomComboBox.GetPreferredSize(  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;  WithThemeSpace: Boolean);begin  PreferredHeight := 0;    {JP Don't allow csSimple to query this, otherwise it will have limited size change counts}  if (AWinControl.HandleAllocated)and (TCustomComboBox(AWinControl).Style <> csSimple) then    PreferredHeight := AWinControl.Height;end; ---------------------------------------------------------------------- wp · 2020-05-28 22:26 Let's continue the discussion in the bug tracker - that's where it belongs to.