ListView & TreeView 的绘制

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
ListView & TreeView 的绘制:
procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
var
p:trect;
begin
if cdsselected in state then
begin
listview1.Canvas.Font.Color:=clgreen;
listview1.Canvas.brush.Color:=clred;
p:=item.displayrect(drselectbounds);
listview1.Canvas.FillRect(p);
listview1.Canvas.Textout(p.Left+2,p.Top,item.Caption);
listview1.Canvas.brush.Color:=clblue;
listview1.Canvas.FrameRect(item.displayrect(drselectbounds));
defaultdraw:=false;
end;
end;
 
后退
顶部