Assigning event

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2005
Posts: 6
Reputation: Tepes is an unknown quantity at this point 
Solved Threads: 0
Tepes Tepes is offline Offline
Newbie Poster

Assigning event

 
0
  #1
Aug 13th, 2005
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!!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 6
Reputation: neverwinter is an unknown quantity at this point 
Solved Threads: 0
neverwinter neverwinter is offline Offline
Newbie Poster

Re: Assigning event

 
0
  #2
Aug 31st, 2005
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;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2088 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC