943,880 Members | Top Members by Rank

Ad:
Aug 13th, 2005
0

Assigning event

Expand Post »
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!!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Tepes is offline Offline
6 posts
since Aug 2005
Aug 31st, 2005
0

Re: Assigning event

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;
Reputation Points: 10
Solved Threads: 0
Newbie Poster
neverwinter is offline Offline
6 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Packets sending...
Next Thread in Pascal and Delphi Forum Timeline: TChart - [Fatal Error] File not found: TeeConst.pas





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC