Reputation: 11
I have multiple TButton
s on a TPageControl
. The first 3 work, when I double-click on them, the IDE takes me to their procedure (ie procedure TForm3.btn1q1Click(Sender: TObject);
) but it gives me this error on the rest:
cannot find implementation of method
I looked into the type
code and realized that it lists all the buttons like this:
type
TForm3 = class(TForm)
pgc: TPageControl;
pgclogin: TTabSheet;
lblname: TLabel;
lblsurnaME: TLabel;
edtname: TEdit;
EDTSUR: TEdit;
btncontinue: TButton;
pgcdiff: TTabSheet;
rpgdiff: TRadioGroup;
pgcsun: TTabSheet;
btn1q1: TButton;
btn1q2: TButton;
btn1q3: TButton;
btn1q4: TButton;
btn1q5: TButton;
btn1q6: TButton;
btn1q7: TButton;
btn1q8: TButton;
btn1q9: TButton;
mem1: TMemo;
pgcmercury: TTabSheet;
Btn2q6: TButton;
but only the 1st 3 (the working ones) are listed like this:
procedure btn1q1Click(Sender: TObject);
procedure btn1q2Click(Sender: TObject);
procedure btn1q3Click(Sender: TObject);
I added 2 more manually:
procedure btn1q4Click(Sender: TObject);
procedure btn1q5Click(Sender: TObject);
but it still gives that error.
What can I do? I am completely lost.
Upvotes: 1
Views: 182
Reputation: 6013
It is possible that the buttons already have a field in the OnClick event that has been (accidentally?) deleted from the source. If this has happened you will get this error.
To check, instead of double clicking on the button, single click on the button and go to the object inspector (bottom left of the screen by default) and select the 'Events' tab. Look for the 'OnClick' event. If there is anything in there, delete it. Now your double-click should work.
Upvotes: 1
Reputation: 11
Sometimes this error can occur if the *.pas file contains strange (invisible) characters. Perhaps you can use a text editor that can display invisible control codes and then remove them. Of course, back up the *.pas file first so that nothing else gets broken.
https://en.delphipraxis.net/topic/11014-ummmm-what/?do=findComment&comment=87699
Upvotes: 1