unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Controls, Forms,
Dialogs, StdCtrls, Grids, ExtCtrls, ComCtrls;
type
TForm1 =
class
(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
DateTimePicker1: TDateTimePicker;
Button2: TButton;
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObject);
private
public
end
;
var
Form1: TForm1;
Col :
integer
=
1
;
Row :
integer
=
1
;
implementation
{$R *.dfm}
procedure
TForm1
.
Button1Click(Sender: TObject);
var
i:
integer
;
begin
for
i := StringGrid1
.
FixedRows
to
StringGrid1
.
RowCount -
1
do
StringGrid1
.
Rows[i].Clear;
StringGrid1
.
Cells[Col, Row]:= DateToStr(DateTimePicker1
.
Date);
inc(Col);
if
Col = StringGrid1
.
ColCount
then
begin
Col:=
1
;
inc(Row);
if
Row = StringGrid1
.
RowCount
then
Row:=
1
;
end
;
end
;
procedure
TForm1
.
Button2Click(Sender: TObject);
begin
Close;
end
;
end
.