unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ZAbstractConnection, ZConnection,
Data.DB, Vcl.StdCtrls, Vcl.Grids, Vcl.DBGrids, ZAbstractRODataset,
ZAbstractDataset, ZDataset;
type
TForm1 = class(TForm)
ZConnection1: TZConnection;
ZQuery3: TZQuery;
DataSource3: TDataSource;
DBGrid1: TDBGrid;
Button1: TButton;
procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
DBGrid1.Canvas.Brush.Color:=clInfoBk;
DBGrid1.Canvas.Font.Color:=clBlack;
Dbgrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
i :=1;
ZQuery3.first;
while not ZQuery3.eof do
begin
if ZQuery3.RecNo = i then
begin
DBGrid1.Canvas.Brush.Color:=clInfoBk;
DBGrid1.Canvas.Font.Color:=clBlack;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
sleep(250);
ZQuery3.Next;
i := I+1;
end;
end;
end.
wyżej zamieściłem kod, którego zadaniem jest zmiana koloru wiersza przetwarzanego w danej chwili, po pierwsze kompilator zgłasza błąd
"[dcc32 Error] Unit1.pas(57): E2250 There is no overloaded version of 'Rect' that can be called with these arguments' i
"[dcc32 Error] Unit1.pas(57): E2003 Undeclared identifier: 'Column' "
nie potrafie umiejscovic gdzie tkwi błąd,