如何TListView中显示不同颜色和字体? 在ViewStyle=vsReport的情况下,希望显示不同颜色的字体。在ListView1CustomDrawSubItem事件中可以控制,但怎么样得到Item.SubItems显示的位置呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 方法如下,不需要得到Item.SubItems显示的位置,因为ListView会自动画,你只需要设置好画布就行了:procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean);begin case SubItem of 1: begin ListView1.Canvas.Font.Color := clBlue; ListView1.Canvas.Font.Name :='宋体'; end; 2: begin ListView1.Canvas.Font.Color := clRed; ListView1.Canvas.Font.Name :='黑体'; end; else begin ListView1.Canvas.Font.Color := clBlack; ListView1.Canvas.Font.Name :='仿宋体'; end; end;end; 请教高手,delphi中float的有效位多少,怎么改成15位的有效位? 求一个算法 寻求类似可乐吧的网络图形游戏开发,酬金5K~~ 在学校bbs上看到一份兼职,找了之后发现很奇怪啊,大家遇到过么?哈 条形码控件 服务器上如何获取客户端的ip地址,如果是远程登录的要知道它的外网ip。分不够可以加! delphi xe2 求内存读取 如何从delphi中调用word文档 ?添加一个事件:OnBeforeChange 谁有quickreport3。06?是要!3。06的。 水晶报表 动态创建多个控件,在释放控件时产生错误'List index out of bounds(4)',高手请进来看看!
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
case SubItem of
1:
begin
ListView1.Canvas.Font.Color := clBlue;
ListView1.Canvas.Font.Name :='宋体';
end;
2:
begin
ListView1.Canvas.Font.Color := clRed;
ListView1.Canvas.Font.Name :='黑体';
end;
else
begin
ListView1.Canvas.Font.Color := clBlack;
ListView1.Canvas.Font.Name :='仿宋体';
end;
end;
end;