少
少爷的拐杖
Unregistered / Unconfirmed
GUEST, unregistred user!
我想画一个只有1列,11行的stringgrid,前4行一种颜色,后7行另一种颜色。
现执行后除了第一行颜色没变,其他都变的符合要求,怎么回事啊?
代码如下:
procedure TFm_OffSet_Box.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
begin
if ARow<3 then
begin
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 12, Rect.Top + 8, Cells[ACol, ARow]);
Canvas.Brush.Color:=$00B8C1C7;
end
else
begin
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 12, Rect.Top + 8, Cells[ACol, ARow]);
Canvas.Brush.Color:=$00DCB8B8;
end;
end;
end;
现执行后除了第一行颜色没变,其他都变的符合要求,怎么回事啊?
代码如下:
procedure TFm_OffSet_Box.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
begin
if ARow<3 then
begin
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 12, Rect.Top + 8, Cells[ACol, ARow]);
Canvas.Brush.Color:=$00B8C1C7;
end
else
begin
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 12, Rect.Top + 8, Cells[ACol, ARow]);
Canvas.Brush.Color:=$00DCB8B8;
end;
end;
end;