在StringGrid的OnDrawCell事件中:procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
S:string;
R:TRect;
begin
S:=StringGrid1.Cells[ACol, ARow];
R:=Rect;
with StringGrid1 do
DrawText(Canvas.handle,PChar(S),-1,R,DT_WORDBREAK); //自动按单词换行
end;
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
S:string;
R:TRect;
begin
S:=StringGrid1.Cells[ACol, ARow];
R:=Rect;
with StringGrid1 do
DrawText(Canvas.handle,PChar(S),-1,R,DT_WORDBREAK); //自动按单词换行
end;
解决方案 »
- 关于Sybase数据库的问题
- 急,Idhttp Post问题,在线等!
- 关于计时器的问题,为何总时间大于设计的时间呢?菜鸟请教!在线等.........................
- WebBrowser
- 戴志康: 一个23岁的年轻人 一名在读的大四学生 一个三年30万的程序员 一家中关村新创软件公司的CEO
- image.visable false->ture时闪烁怎么办?
- 制作安装文件时,用MSSQLSERVER2000怎么把数据库文件,自动加入到用户的MSSQLSERVER2000服务器中
- 我实在不知道是怎么回事
- Delphi 如何实现图标的叠加?
- 求助:哪位高手有采用CRCCCITT标准的数据OCR检验算法的delphi源程序,有急用!!!!
- 关于ACTIVEX控件的问题,高手请进!
- 为什么ADO连不上SQL SERVER2000
当然程序还是写在:OnDrawCell事件里面。