procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
with Canvas do
begin
if (ARow=Row)and(ACol>=FixedCols) then //设置你的条件
Font.Color:=clRed
else
if (ARow>=FixedRows)and(ACol>=FixedCols) then Font.Color:=clBlack;
FillRect(Rect);
end;end;
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
with Canvas do
begin
if (ARow=Row)and(ACol>=FixedCols) then //设置你的条件
Font.Color:=clRed
else
if (ARow>=FixedRows)and(ACol>=FixedCols) then Font.Color:=clBlack;
FillRect(Rect);
end;end;
解决方案 »
- 求助:invalid stream fortmat!
- 如何限定在DBGrid中限定特定的列的输入类型
- 大家快來幫忙,等待中。。。。。。。解決了馬上結帖。。。。。
- 如何用WebBrowser捕抓"该页无法显示"网页?
- 在SQL Server上创建新用户,采用什么语句?什么顺序?
- 救急呀!!!在98下怎么和局域网外的sqlserver建立连接?为什么会出错???
- word中比较两个表格的内容,请大家畅所欲言
- 一个关于鼠标拖动的问题,请指教!
- dbgrid的刷新问题
- dephi6有没有adoexpress的升级包??我想要。。。。
- 一个小问题如何把DBGRID的每个字段长度固定住,不随实际表中的长度变化而变化
- 关于独占与上锁的问题?????
Rect: TRect; State: TGridDrawState);
begin
with StringGrid1 do
begin
if ARow mod 2 = 0 then
Canvas.Font.Color := clRed
else
Canvas.Font.Color := clGreen;
Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]);
end;
end;
Rect: TRect; State: TGridDrawState);
begin
if (acol = 2) and(arow >0) then
begin
stringgrid1.Font.Color:=clRed;
end;
这样不可以吗?
Rect: TRect; State: TGridDrawState);
begin
if (acol = 2) and(arow >0) then
stringgrid1.Font.Color:=clRed;
end;
l_kaifeng(江南大哥) 好像不行
taxi(游少爷) 可以l_kaifeng(江南大哥)再试一下等下按功全部一起给分
的是不是条件只能是Row or col
for example ;
if cell[1,arow] = 'a' then
font.color := clred
并且Arow这一行都为Red
好何做
因为我也用,可能某处没设好,不行