Witam mam komponent ListView po ktorym sobie rysuje. Procedura OdDrawitem wygląda następująco:
procedure LUserDrawItem(Sender: TCustomListView;
Item: TListItem; Rect: TRect; State: TOwnerDrawState);
Var
I : Integer;
Kolor : TColor;
R : TRect;
begin
if odSelected in state then begin
R.Left := Rect.Left;
R.Top := Rect.Top;
R.Right := Rect.Right;
R.Bottom := Rect.Bottom-1;
LUser.canvas.Brush.Color := $0053D2FF;
LUser.canvas.FillRect(Rect);
LUser.canvas.Brush.Color := $000080C4;
LUser.canvas.FrameRect(R);
LUser.canvas.Font.Color := clBlack;
LUser.canvas.Brush.Style := bsClear;
end else begin
if Odd(Item.Index) then kolor := clWhite
else kolor := $00F4F4F4;
LUser.Canvas.Brush.Color := kolor;
LUser.canvas.FillRect(Rect);
LUser.Canvas.Font.Color := clBlack;
end;
LUser.Canvas.TextOut(Rect.Left + 5, Rect.Top + 5, Item.Caption);
LUser.Canvas.TextOut(Rect.Left + 5 + LUser.Columns[0].Width, Rect.Top + 5, Item.Subitems[0]);
LUser.Canvas.TextOut(Rect.Left + 5 + LUser.Columns[0].Width+ LUser.Columns[1].Width, Rect.Top + 5,
Item.Subitems[1]);
end;
Wszystko jest pieknie ale kiedy rozciągam którąś z kolumn mam taki problem:
http://images30.fotosik.pl/15/765cf90dc2d8e336med.jpg
wydaje mi sie ze podczas zmiany rozmiaru kolumn nie ma odświezania. Pracuje na delphi 5 jesli ktos ma jakis pomysl jak tego uniknac to prosze o pomoc.