Disabling Form Designer in DelphiXE

Is it possible to disable the form designer in DelphiXE "on demand / selectively" and work only with the code of the form / class, where necessary, if the controls are not installed in the IDE?

+6
source share
3 answers

I would say that the answer is no, but the workaround that I use is to edit the DFM file and cut out the component that is not there, and paste it into the FormCreate event and create an instance there instead. All properties are in DFM, so a little editing does the job well.

+2
source

No, you cannot disable it selectively. What I often do (since I have almost no controls installed in most of my IDEs), I just open the form, tell Delphi to ignore all errors when loading dfm, edit my source codes and make sure to check in dfm for my source code management system.

You can try to save read-only dfm in order to avoid erroneous validation in dfm using remote controls, but there is a drawback: every time you try to save the source code, an error occurs in the IDE regarding the readonlyness file. If you press Ctrl-S or Shft-Ctrl-S as often as I do, it quickly becomes a nuisance.

When I need to change dfm, I do it in text mode or install controls, modify and submit dfm. After that, I'm free again to remove controls and just work with the pas file, ignoring / reverting any changes to dfm.

+1
source

No, and there is currently no reasonable solution for this.

I asked for this to be in Delphi at some point in the future; These DFMs should not be destroyed by opening them, and several modal dialog boxes should not appear asking if you want to destroy your DFMs by default when opening a form in which the installed controls are not installed.

In the end, there is only one practical solution; Install all controls. Everything else will just go crazy.

+1
source

Source: https://habr.com/ru/post/893341/


All Articles