【发布时间】:2012-09-29 13:08:57
【问题描述】:
如何在 Delphi 7 中使用程式化表格? 例如:
【问题讨论】:
-
您的示例并不是真正的“风格”,而是“定制”。这里的一种方式:delphi.about.com/od/usedbvcl/l/aa031699.htm
-
philnext,没有。不仅是颜色。
如何在 Delphi 7 中使用程式化表格? 例如:
【问题讨论】:
如果您想以 TDbGrid 组件为主题,您可以使用 Jeremy North 和 Andreas Hausladen 的 Themed DBGrid runtime replacement。
【讨论】:
TXPManifest 组件添加到您的应用程序中?
我在 Delphi 7 和 Windows 8.1 上为您编写并测试了这个示例
使用事件 DrawColumnCell 来改变颜色或其他东西。
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;
下载完整示例: file
【讨论】: