Rename the VCL form class in C ++ Builder XE2

At work, we have a fairly large application of VCL VCL forms. It compiles in Embarcadero XE2, but leaves many years ago. I need to add a new form to this application.

When you do File> Add New> VCL Form, a form is created where the class name is TForm1 . Also, a pointer is created like this: TForm1 *Form1

For obvious reasons, I want to rename the form and pointer to say TStuffForm and *StuffForm . The problem is that I cannot get it to work!

For any real XE2 users: What is the canonical way to do this?

I tried to rename directly to code, carefully replacing the lines, but this will not work. The IDE goes crazy and causes a lot of modal pop-ups, and I'm complaining that the TForm1 class is missing. It was so unpleasant that I refused it.

I also tried using refactoring functions in the IDE, but that didn't work either. So now I'm a little stuck.

+4
source share
1 answer

I haven't used XE2 yet, still using RAD studio 2010. However, the following works for me:

  • Go into the design view of your new form.
  • Select a shape from the structure tree (or just click on it).
  • Change the name property of the form.

Then you should change the names of the classes and class pointers.

I can not understand why this will not work in XE and later versions, but, as I mentioned, is not verified.

Update: A proven method works for C ++ Builder 10.1 Berlin.

+6
source

All Articles