Hi folks, 

 

I have a listbox with multicolor (background) for items. That is fine and 
working. Also when itemIndex is changed i draw a rect (FillRect) and selected 
item receives a focus, that is fine also. What isn't is that there is also a 
hollow rectangle on selected item and that is the one
i would like to remove or paint in Fillrect color if possible so it isn't 
visible.  

look at attached picture, that gray rectangle is what i would like to remove 
somehow.




... i looked at some Delphi questions for the same thing and it mentioned that 
the value for that particular focus rect is XORed on original
FillRect color, if i understood articles correctly. But i can't figure out how 
to turn it off in Lazarus.


i tried this also, and it doesn’t work as it should:

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  ARect: TRect; State: TOwnerDrawState);
begin
  with ListBox1.Canvas do begin
    if odFocused in State then
      Brush.Color := clHighlight else
      Brush.Color := clWindow;
    FillRect(ARect);
    TextOut(ARect.left, ARect.Top, Listbox1.Items[Index]);
    if odFocused in State then
      DrawFocusRect(ARect);
  end
end;  

this is a result, no joy:


ListBox.Style is set lbOwnerDrawVariable




If you could land a hand please? 

M.


I am running    Lazarus #:1.4.4    FPC 2.6.4    i386-darwin-carbon

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to