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 XE2, when I create a new data module, it only allows me to place database related components in it (such as TADOConnection
and TDataSource
). Why is this and how can I put other components in it? Is there an alternative?
相关问题
- Is there a Delphi 5 component that can handle .png
- Is there a way to install Delphi 2010 on Windows 2
- Is TWebBrowser dependant on IE version?
- iOS objective-c object: When to use release and wh
- DBGrid - How to set an individual background color
相关文章
- Best way to implement MVVM bindings (View <-> V
- Windows EventLog: How fast are operations with it?
- How to force Delphi compiler to display all hints
- Coloring cell background on firemonkey stringgrid
- HelpInsight documentation in Delphi 2007
- Can RTTI interrogate types from project code at de
- What specifically causes EPrivilege to be raised?
- Equivalent to designer guidelines in code
Data modules changed with the XE2 release. Remember that XE2 introduced a new component framework, FireMonkey, in addition to the long-standing VCL. A new pseudo-property, named
ClassGroup
was added to data modules. This controls what components can be added to the data module in the IDE designer.The default
ClassGroup
for a data module isSystem.Classes.TPersistent
. This specifies that the data module is framework neutral and so accepts neither VCL components nor FMX components.In your case you probably want to accept VCL components so you need to specify a
ClassGroup
ofVcl.Controls.TControl
.Read all about
ClassGroup
in the documentation.This (buggy) behavior in
is caused by the line
To get rid of just delete or modify the line into
After switch to
Design
View you will see all the components as you expect.(Delphi XE2 16.0.4504.48759)