Recent

Author Topic: how to rename/save a secondary form  (Read 923 times)

QEnnay

  • Full Member
  • ***
  • Posts: 132
how to rename/save a secondary form
« on: February 19, 2026, 06:17:11 pm »
Hi,

I have a 2nd form, "grid" displaying a database as a grid etc. I want to add other functionality and would like to have it as known "search" instead of "grid."

I tried saving it as "search" then  changing the first line, adding it to the main-form "uses" etc and now I get an error message about there being "no .lfm" even though there was a "search.lfm" created and exists in the project folder.

I can roll back to a backup before the "search" save and try again, so what's the trick?

Thanks
Linux-Mint 22.2 x64 + Cinnamon; i7, 32GB memory
Lazarus 4.4-64bit

jamie

  • Hero Member
  • *****
  • Posts: 7663
Re: how to rename/save a secondary form
« Reply #1 on: February 19, 2026, 11:07:36 pm »
Use the object inspector to rename items, don't do it directly because there will be no corrective LFM file created.

The form has a name in the OI, change it there.

Jamie
The only true wisdom is knowing you know nothing

Zvoni

  • Hero Member
  • *****
  • Posts: 3361
Re: how to rename/save a secondary form
« Reply #2 on: February 20, 2026, 08:17:51 am »
Or create the Form as a Template, and derive the following Forms from it....
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Thaddy

  • Hero Member
  • *****
  • Posts: 18982
  • Glad to be alive.
Re: how to rename/save a secondary form
« Reply #3 on: February 21, 2026, 11:28:55 am »
ctrl-shift-E refactoring.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1225
Re: how to rename/save a secondary form
« Reply #4 on: March 08, 2026, 07:25:59 pm »
Hi,

I have a 2nd form, "grid" displaying a database as a grid etc. I want to add other functionality and would like to have it as known "search" instead of "grid."

I tried saving it as "search" then  changing the first line, adding it to the main-form "uses" etc and now I get an error message about there being "no .lfm" even though there was a "search.lfm" created and exists in the project folder.

I can roll back to a backup before the "search" save and try again, so what's the trick?

Thanks


1. Turn off AutoSave [Go to Tools → Options → Environment → AutoSave];
2. Save the project;
3. Change form name using Object Inspector [F11];
4. Save As unit to new name[.pas];
5. Quit Lazarus IDE without saving anythng else, especially (above all) not saving project;
6. Reopen project in Lazarus IDE;
7. Add new unit name [recently saved] on project;
8. Save project.

Now, you are ready to go with both grid.pas and search.pas on the same project.
« Last Edit: March 12, 2026, 09:59:18 pm by valdir.marcos »

 

TinyPortal © 2005-2018