5,391
社区成员
发帖
与我相关
我的任务
分享
procedure Tfrm_Main.GDT_UserListCustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
var
i: Integer;
PSPID: string;
begin
PSPID := AViewInfo.GridRecord.DisplayTexts[3];
if (PSPID = '3') or (PSPID = '4') then
begin
mCanvas := ACanvas;
mCanvas.Brush.Color := clRed;//这儿可以改变
//TThread.CreateAnonymousThread(SetGline).Start;
SetGline;
end;
end;
//下面代码不能改变颜色
procedure Tfrm_Main.SetGline;
var
I: Integer;
begin
for I := 0 to 9 do
begin
mCanvas.Brush.Color := clRed;
mCanvas.Refresh;
Sleep(100);
mCanvas.Brush.Color := clWhite;
Sleep(100);
mCanvas.Refresh;
end;
end;