M
milesmaqi
Unregistered / Unconfirmed
GUEST, unregistred user!
请大家先看这一行代码!!
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
bmp:tbitmap;
outrect:trect;
bmpwidth:integer;
begin
outrect:=rect;
这一行代码是什么意思呢? //// if (column.Field =table1.fields.FieldByName('Common_Name')) then
begin
bmp:=tbitmap.Create;
try
bmp.Assign(table1.fieldbyname('Graphic'));
bmpwidth:=(rect.Bottom -rect.Top )*3;
outrect.Right :=rect.Left +bmpwidth;
这里是什么意思呢?//// dbgrid1.Canvas.StretchDraw(outrect,bmp);
except
bmp.free;
end;
if table1.fieldbyname('Length (cm)').asinteger>100 then
begin
dbgrid1.Canvas.Font.color:=clred;
dbgrid1.Canvas.Font.style :=[fsbold];
end;
outrect:=rect;
outrect.left:=outrect.Left +bmpwidth;
end;
这一行代码又是什么呢???? ////dbgrid1.DefaultDrawDataCell(outrect,column.field,state);
end;
我是DELPHI5弟弟手,感谢大家,
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
bmp:tbitmap;
outrect:trect;
bmpwidth:integer;
begin
outrect:=rect;
这一行代码是什么意思呢? //// if (column.Field =table1.fields.FieldByName('Common_Name')) then
begin
bmp:=tbitmap.Create;
try
bmp.Assign(table1.fieldbyname('Graphic'));
bmpwidth:=(rect.Bottom -rect.Top )*3;
outrect.Right :=rect.Left +bmpwidth;
这里是什么意思呢?//// dbgrid1.Canvas.StretchDraw(outrect,bmp);
except
bmp.free;
end;
if table1.fieldbyname('Length (cm)').asinteger>100 then
begin
dbgrid1.Canvas.Font.color:=clred;
dbgrid1.Canvas.Font.style :=[fsbold];
end;
outrect:=rect;
outrect.left:=outrect.Left +bmpwidth;
end;
这一行代码又是什么呢???? ////dbgrid1.DefaultDrawDataCell(outrect,column.field,state);
end;
我是DELPHI5弟弟手,感谢大家,