1个回答
展开全部
自己手绘
stringgrid的onDrawCell
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
r:TRect;
begin
with StringGrid1.Canvas do
begin
if gdSelected in State then
Brush.Color:=clRed
else
Brush.Color:=clWhite;
FillRect(rect);
SetRect(r,Rect.Left+2,Rect.Top+2,Rect.Right-3,Rect.Bottom-3);
Font.Color:=clBlack;
DrawText(Handle,PAnsiChar(StringGrid1.Cols[acol][arow]),
-1,R,DT_CENTER or DT_WORD_ELLIPSIS);
end;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询