i create an array of panels
var bt:array[1..3,1..2] of TPanel;

so i go in Form1.FormCreate and i write:

for i:=1 to 3 do
for j:=1 to 2 do
begin
bt[i, j]:=TPanel.Create(self);
bt[i, j].Parent:=self;
bt[i, j].OnCLick:=????????????????????????????????;
end;

i created a procedure TForm1.press(x,y:integer) what should do the OnClick and i wrote in Form1.FormCreate
bt[i,j].OnClick:=TForm1.press(j,i)
but i get only error

some 1 pls tell me what i have to do!!!

What was the error message?

I believe that TPanel.OnClick requires a TNotifyEvent. This basically means that your procedure must follow this syntax:

procedure (Sender: TObject) of object;

Example:

procedure Press(Sender: TObject);

Then, you can do the following:

OnClick := Press;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.