如何让TStringGrid的指定单元格的文字为指定颜色,其它单元格文字颜色不变?

sinth 2003-08-20 08:24:34
RT
...全文
32 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sinth 2003-08-22
  • 打赏
  • 举报
回复
不行啊!!
niuzhenjun 2003-08-20
  • 打赏
  • 举报
回复
up
MEFULEU 2003-08-20
  • 打赏
  • 举报
回复
void __fastcall TcurveForm::sgridDrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
try


{
if (ARow==1) sgrid->Canvas->Brush->Color =clBtnFace;

if(ARow >=sgrid->RowCount-4)
{
sgrid->Canvas->Font->Color = clBlue;

if(ARow%2 == 0)
{
sgrid->Canvas->Brush->Color=TJBckColor;
}
else
{
sgrid->Canvas->Brush->Color=TColor(TJBckColor-colorm);
}
}

sgrid->Canvas->FillRect(Rect);
DrawText(sgrid->Canvas->Handle, sgrid->Cells[ACol][ARow].c_str(), -1, (RECT*)&Rect, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
}
catch(Exception &e)
{
return;
//dtmJCEConnection->ErrRecord(2, e.Message, "TcurveForm::sgridDrawCell");
}

}

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧