How do I reduce “uses” boilerplate for new forms?

后端 未结 4 599
梦毁少年i
梦毁少年i 2021-01-11 16:31

Every time I add a new form to my project, it drops a big glop of boilerplate in the uses clause.

uses
  Windows, Messages, SysUtils, Variants, Classes, Grap         


        
4条回答
  •  清酒与你
    2021-01-11 17:15

    You are not saving anything by removing Windows and Messages. Graphics and Dialogs may get added back in based on what components you drop on the form, and they are fairly useful to reference anyway. Doubt you are saving much by removing them. Feel free to remove variants if you are not using them (which I agree is pretty common unless doing COM or DB development).

    I guess it all depends on your objective in cleaning the uses clause. Variants is really the only one that may have an impact on your application.

    As far as changing the default template, I believe it is in a package that says if you are descending from a TForm then you get those. You would most likely need to modify a .PAS file and rebuild the VCL packages. A lot of work for very little gain.

提交回复
热议问题