
July 25th, 2012, 12:37 PM
|
|
Contributing User
|
|
Join Date: Jun 2008
Posts: 255
 
Time spent in forums: 3 Days 2 m 15 sec
Reputation Power: 5
|
|
Note the difference in your procedure header:
Yours:
Procedure changeLabelName;
As part of your Form Object (assuming form is called Form1)
Procedure TForm1.changeLabelName;
As declared, ChangeLabelName has no reference to your form, it is in essence a global procedure, not a method of your form. Caption is a property of TForm, which your form is derived from.
So, if you are adding ChangeLabelName as a procedure to your form, you need to add it to your form's declaration (presumably in the private section - unless you want to be able to call it from another form)
Code:
TForm1 = class(TForm)
...
private
procedure ChangeLabelName;
...
end;
After declaring it in the Form's object, you can use the keyboard shortcut Ctrl-Shift-C, and it will add the method's stub into your code.
Last edited by majlumbo : July 25th, 2012 at 12:44 PM.
|