德尔福XE2
我是第一次尝试创建 ActiveX 控件。 步骤如下
1) 创建ActiveX库 2) 创建ActiveX控件 向导字段“组件名称”不显示我的 VCL 组件。该组件在已安装的软件包下可见,并且 .bpl 中的其他组件在“组件名称”下拉列表中可见。
为什么有些组件可见而其他组件不可见
TIA
以法莲
最佳答案
可以封装在 ActiveX 中的 VCL 控件必须是未标记为不兼容的 TWinControl
后代,并且已安装在 IDE 中或已将其单元添加到项目中。来自 Delphi docwiki (强调我的):
In the ActiveX Control wizard, select the name of the VCL control that will be wrapped by the new ActiveX control. The dialog lists all available controls, which are descendants of
TWinControl
that are not registered as incompatible with ActiveX using theRegisterNonActiveX
procedure.Tip: If you do not see the control you want in the drop-down list, check whether you have installed it in the IDE or added its unit to your project.
因此,您要做的第一件事是确保您的组件源自 TWinControl
,而不仅仅是 TComponent
。
关于Delphi ActiveX 控件向导,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15024458/