问题
How to use stylized table in Delphi 7? For example:
回答1:
If you mean which you want themed the TDbGrid component, you can use the Themed DBGrid runtime replacement from Jeremy North's and Andreas Hausladen.
回答2:
I wrote and tested for you this example on Delphi 7 and Windows 8.1
Use Event DrawColumnCell to change color or something else.
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
try
if Column.FieldName = 'FIRST_NAME' then
DBGrid1.Canvas.Brush.Color := clGreen;
finally
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
Download full example: file
来源:https://stackoverflow.com/questions/12652955/delphi-7-tdbgrid-style