July 25th, 2012, 01:37 PM
Join Date: Jun 2008
Time spent in forums: 3 Days 10 h 40 m 33 sec
Reputation Power: 6
Note the difference in your procedure header:
As part of your Form Object (assuming form is called Form1)
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)
TForm1 = class(TForm)
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 01:44 PM.