我有一个自定义的 FireMonkey 控件 (TComboBox),它也有一个自定义的 TComponentEditor。当我覆盖 ExecuteVerb 方法并尝试添加子组件(自定义 TListBoxControl)自定义 TComboBox 时,它不会在设计时显示
默认 TComboBox 行为:
自定义 TComboBox
我的 ExecuteVerb 代码:
var
PpComboItem : TPpListBoxItem;
PpCombo: TPpComboBox;
begin
if (Component is TPpComboBox) then
PpCombo := (Component as TPpComboBox) else
exit;
PpComboItem := TPpListBoxItem.Create(PpCombo);
PpComboItem.Parent := PpCombo;
end
我试图追踪 TComboBox 尝试执行此操作的方式,但似乎无法找到具有正确实现的单元
** 编辑 **
好的 - 我已经设法了解了 TMS 的人如何通过他们的组件(购买和支付)实现这一目标,并且我已经设法推断出以下内容
var
PpComboItem : TPpListBoxItem;
PpCombo: TPpComboBox;
begin
inherited;
if (Component is TPpComboBox) then
PpCombo := (Component as TPpComboBox) else
exit;
PpComboItem := (TPpListBoxItem(Designer.CreateComponent(TPpListBoxItem, PpCombo, 10, 10, 100, 100)));
PpComboItem.Parent := PpCombo;
Designer.Modified;
end;
但是当我在 ComponentEditor 中单击 AddTPpListBoxItem 时,我收到以下错误:
TPpListBoxItem 类不适用于此模块