将stringgrid的defaultdrawing属性改为false,然后:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (acol=1) and (arow=1) then
rect.Bottom:=rect.Bottom+rect.Bottom-rect.Top;
if not((acol=1) and (arow=2)) then
begin
stringgrid1.Canvas.FillRect(Rect);
stringgrid1.canvas.textout(rect.left,rect.top+18,StringGrid1.cells[acol,arow]);
end;
end;
以上代码仅说明原理。
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (acol=1) and (arow=1) then
rect.Bottom:=rect.Bottom+rect.Bottom-rect.Top;
if not((acol=1) and (arow=2)) then
begin
stringgrid1.Canvas.FillRect(Rect);
stringgrid1.canvas.textout(rect.left,rect.top+18,StringGrid1.cells[acol,arow]);
end;
end;
以上代码仅说明原理。
解决方案 »
- 新站点请兄弟们看看,多提点意见(http://www.duxiu.com http://mylib.duxiu.com)
- 怎么使拖拉文件到我的应用程序或双击某个类型的文件直接打开它
- 老公过生日送他什么礼物好呢?男人一般喜欢什么生日礼物?请大家帮忙!!!
- 问计算两个日期之间的天数(除去星期六,星期天)!!!!
- 自己写的软件终于有人要了,不过要我开具正规的发票,我没有办法提供发票。。。苦恼。。。
- 求QQ华夏找血基址的方法
- Delphi6 的 TQuery 读 FoxPro 表中文记录时乱码,如何解决?请帮个忙!谢谢!!!
- function函数的规则?
- 1、如果有两个独立的,结构相同的数据库,想把当前记录追加到另一个数据库中去。我用了insert to a1.db from a2.db 没有用,请问哪里错了。
- 请教使用ImageEN缩放图片的方法
- 20分向大虾请教,delphi+access的问题?
- 请问用fastreport控件如何直接打印到打印机????而不用经过预览!
例如XLGrid等等