{ First }
ListBox1.Style := lbOwnerDrawFixed; { or := lbOwnerDrawVariable; }{ 2th,控制每一个ListBox项的高度,宽度一致,由ListBox1.Width指定 }
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
{ Index: ListBox项的索引
Height: 高度 }
end;{ 3th, 画图标 }
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
{ Control: ListBox1
Index: 项的索引
Rect: 项的矩形
State: 项的状态
根据这些信息,你可以把你要画的图标画在Control上
}
end;
ListBox1.Style := lbOwnerDrawFixed; { or := lbOwnerDrawVariable; }{ 2th,控制每一个ListBox项的高度,宽度一致,由ListBox1.Width指定 }
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
{ Index: ListBox项的索引
Height: 高度 }
end;{ 3th, 画图标 }
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
{ Control: ListBox1
Index: 项的索引
Rect: 项的矩形
State: 项的状态
根据这些信息,你可以把你要画的图标画在Control上
}
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货