type
tDotLineGrid = class(TStringGrid)
private
{ Private declarations }
protected
{ Protected declarations }
procedure DrawCell(ACol, ARow: Longint; ARect: TRect;
AState: TGridDrawState); override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [tDotLineGrid]);
end;
procedure tDotLineGridGrid.DrawCell(ACol, ARow: Longint; ARect: TRect;
AState: TGridDrawState);
Var
I, TmpWidth : Integer;
begin
Canvas.Pen.Color := clblack;
Canvas.Pen.Style := psSolid;
inherited DrawCell(ACol, ARow, ARect, AState);
TmpWidth := 0;
for I := 1 to RowCount do
begin
if ( (I > 0) and (not odd( I ) ) ) then
begin
//Canvas.Pen.Color := clblack;
Canvas.Pen.Style := psDot;
end
else
begin
//Canvas.Pen.Color := clblack;
Canvas.Pen.Style := psSolid;
end;