1

可能重复:
在 vsReport 模式下的 ListView 项目和行的着色

我有一个问题:ListView 中的项目被添加到单独的线程中,其中一些元素必须是彩色的,但它们只有在将指针带到项目时才会被着色。如何解决这个问题呢?

这样做的颜色元素(OnAdvancedCustomDrawItem):

procedure TFGlavnaya.LVThreadsListAdvancedCustomDrawItem(
  Sender: TCustomListView; Item: TListItem; State: TCustomDrawState;
  Stage: TCustomDrawStage; var DefaultDraw: Boolean);
begin
  try
    if Item.SubItems[0] = '' then
      begin
        Sender.Canvas.Font.Color := clBlue;
        Sender.Canvas.Font.Style := Sender.Canvas.Font.Style + [fsBold];
      end;
  except
    Exit;
  end;
end;
4

0 回答 0