Delphi XE2 Data Module expects only database components?

前端 未结 2 2020
臣服心动
臣服心动 2020-12-17 10:28

In prior versions of Delphi, I have used the data module (TDataModule) as a place to keep non-visual components to avoid cluttering up the main form. In Delphi

2条回答
  •  难免孤独
    2020-12-17 10:39

    This (buggy) behavior in

    unit Unit2;
    
    interface
    
    uses
      System.SysUtils, System.Classes;
    
    type
      TDataModule2 = class(TDataModule)
      private
        { Private-Deklarationen }
      public
        { Public-Deklarationen }
      end;
    
    var
      DataModule2: TDataModule2;
    
    implementation
    
    {%CLASSGROUP 'System.Classes.TPersistent'}
    
    {$R *.dfm}
    
    end.
    

    is caused by the line

    {%CLASSGROUP 'System.Classes.TPersistent'}
    

    To get rid of just delete or modify the line into

    {.%CLASSGROUP 'System.Classes.TPersistent'}
    

    After switch to Design View you will see all the components as you expect.

    (Delphi XE2 16.0.4504.48759)

提交回复
热议问题