July 25th, 2012, 12:37 PM
Join Date: Jun 2008
Time spent in forums: 3 Days 2 m 15 sec
Reputation Power: 5
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 12:44 PM.