再试一个代码,呵呵procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);Const CHARARR:ARRAY [1..2] OF String=('你','好'); COLARR:ARRAY [1..2] OF TColor=(clRed,clBlue);Var X,Y,I:Integer; iPos:Integer; S,Head:String;begin S := StringGrid1.Cells[ACol,ARow]; For I:=Low(CHARARR) to High(CHARARR) do Begin iPos := Pos( CHARARR,S); Y:=Rect.Top+2; if iPos>0 then begin Head:=Copy(S,1,iPos-1); X:=Rect.Left+2+ TStringGrid(Sender).Canvas.TextWidth(Head); TStringGrid(Sender).Canvas.Font.Color:=COLARR; TStringGrid(Sender).Canvas.TextOut(X,Y,CHARARR); end; End;end;