OwnerDraw in ComboBox - crosscompiling lazarus / 31-LCL ---------------------------------------------------------------------- pebe · 2022-02-09 18:07 Hello everyone. I am using Lazarus 2.2.0RC2 and FPC to 3.2.2 under Linux (crosscompiling environment) and I have a problem with the OwnerDraw method in the ComboBox control working when compiling for the Windows platform. The essence of my use of OwnerDraw method is: - displaying an icon next to a list item - selecting the last selected list item, because it does not do this. Under Linux everything runs as expected and the following code executes correctly: 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 procedure TMainForm.cbContractDrawItem(Control: TWinControl; Index: Integer;  ARect: TRect; State: TOwnerDrawState);var  dy:integer;  lockType:Shortint; begin  lockType:=getContractLastLockType(index);   dy:=(ARect.Height div 2)-8;  if (Index=cbContract.ItemIndex) and not (odSelected in State) then    cbContract.Canvas.Brush.Color:=clActiveCaption      // last choice  else    if odSelected in State then      cbContract.Canvas.Brush.Color:=clHighlight        // current selection    else      cbContract.Canvas.Brush.Color:=clForm;          // normal background  cbContract.Canvas.FillRect(ARect);  cbContract.Canvas.TextRect(ARect, 20, ARect.Top+dy, cbContract.Items[Index]);  if lockType>0 then    ImageList1.Draw(cbContract.Canvas, ARect.Left + 1, ARect.Top + dy, lockType);end;  However, when I compile it for the Windows platform, unheard of things happen Well, it looks as if the list items are not refreshed, which leaves a trace of the selected item. I attach a short video of the behavior (under Linux and Windows https://www.youtube.com/watch?v=yXs-SEC5ekE It's hard for me to say more, because I'm not really familiar with OwnerDraw on Windows Can anyone help with this issue? I would be appreciated