unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
labels =
array [0..25]
of array[0..25]
of tlabel;
TForm1 =
class(TForm)
procedure FormCreate(Sender: TObject);
private
procedure onlabelmove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
public
end;
var Strings : labels;
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.onlabelmove (Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
//Showmessage (Sender.tag);
end;
procedure TForm1.FormCreate(Sender: TObject);
var i,j,k :integer;
begin
j:=0;
k:=0;
while (j<26)
do begin
i:=0;
while (i<26)
do begin
Strings[i][j] := tlabel.Create(self);
strings[i][j].Parent := self;
strings[i][j].Caption := IntToStr(i+j);
strings[i][j].top := i*strings[i][j].Height;
strings[i][j].left := j*20;
strings[i][j].OnMouseMove := onlabelmove;
strings[i][j].Tag := k;
inc (i);
inc (k);
end;
inc (j);
end;
end;
end.