TValueListEditor 添加图标
TValueListEditor 添加图标(简化模型)
如何在控件的下方(没有数据的区域)添加一个长方形图标?
有数据的行简单:
DrawCell中:
Brush.Color := clCream;
Rect.right :=20;
FillRect(r);
[解决办法]
type
TValueListEditor = class(ValEdit.TValueListEditor)
protected
procedure Paint; override;
end;
TForm1 = class(TForm)
v: TValueListEditor;
...
procedure TValueListEditor.Paint;
var
R: TRect;
begin
inherited;
with Canvas do
begin
Brush.Color := clRed;
R := Classes.Rect(2, RowCount*DefaultRowHeight+8, 20, RowCount*DefaultRowHeight+8+62);
FillRect(r);
end
end;