Forum Delphi.cz
FreePascal (FPC) a Lazarus => Obecné => Téma založeno: BigSandy 03-08-2019, 16:14:35
-
Dobrý den.
Pod windows ok.
Přes raspi mi to děla toto.
(https://i.postimg.cc/WzHyGjhH/listbox.png)
Nenajde se tu někdo, kdo použivá a poradí?
Jak se zbavim těch mezer?
Jsem i zkoušel Style nastavit na lbOwnerDrawFixed a ItemHeight.
To už se však se mnou vůbec nebavi a text se nevykresluje.
-
Takže style nastavit na lbOwnerDrawFixed a ItemHeight velikost, a pak
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
begin
with (Control as TListBox).Canvas do begin
Brush.Style := bsSolid;
if not ListBox1.Selected[Index] then begin
Brush.Color := clWhite
end else begin
Font.Color := clWhite;
end;
FillRect(aRect);
Brush.Style := bsClear;
TextOut(aRect.Left, aRect.Top, (Control as TListBox).Items[Index]);
end;
I když nechapu, proč to musím nechat v tom DrawItem překreslovat, ale funguje to. ;D