---- Borland's Delphi Discussion List <[email protected]> wrote:
>
> A few weeks ago I encountered a strange problem which has reared its 
> ugly head again and has left me totally baffled, has anyone else had 
> this problem?
> 
> Initially I had a form (in an application with many forms)with 3 buttons 
> on it, I changed the caption on one of the buttons.  However, after 
> compilation the original caption appeared on the button.  Back in the 
> IDE the new caption was displayed.  Viewing the form as text showed the 
> new caption.  Changing the caption on either of the other two buttons 
> resulted in the new captions showing when running the application.  I 
> also tried moving the offending button to a new position on the form 
> just to check that the modified form was being compiled into the 
> application.  On running the application the button displayed in the new 
> position but with the old caption.  I had other buttons in the 
> application with the same name and same old caption, so I changed the 
> name of the offending button and everything worked great.
> 
> Then last week I changed some design-time text (Lines) in a read-only 
> TMemo.  Same problem.  Again viewing the form as text showed the new 
> text but when running the application the old text appeared.  In this 
> case there was no other TMemo in the application with the same name nor 
> same old text.  The solution was the same as before, I changed the name 
> of the TMemo.
> 
> Now this morning, I've had the same problem again with a button caption.
> 
> Helllllp!  This is driving me mad.

First thing I'd check is that you don't have more than one version of the .dfm 
file for the problematic form hanging around somewhere on the Unit search path. 

That could account for odd persistance of obsolete design time property code 
like this.

Or it could be a corrupted .dfm which can be a very fiddly problem to fix. 

The most straightforward approach, IMO, is to simply recreate the form anew 
which regenerates the .dfm. 

Here's what I do:

1. Create a new blank form
2. Apply any design time properties to the form (size, caption, etc.) to match 
the problem form.
3. On the problem form, select all the components and copy them to the 
clipboard.
4. On the new form, paste the components.
5. In the problem form .pas file, copy the code.
6. Paste the code over the autogenerated code in the new form's .pas file.
7. Close the problem form.
8. Save as... the new form over the problem form.

If those aren't the problem, are you doing anything with custom resources in 
the project?  


Stephen Posey
[EMAIL PROTECTED]
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to