opc*_*0de 3 delphi components delphi-7
我想扩展DbGrid功能,在奇数行和偶数行上添加颜色.所以我写了这个
procedure TGridx.DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);
var
row : Integer;
begin
inherited;
row := Self.DataSource.DataSet.RecNo;
if (row mod 2 = 0) then
Self.Canvas.Brush.Color := FColor1 //some color
else
Self.Canvas.Brush.Color := FColor2; //some color
end;
Run Code Online (Sandbox Code Playgroud)
我做错了什么?
归档时间: |
|
查看次数: |
1380 次 |
最近记录: |