1

カスタム TComponentEditor も持つカスタム FireMonkey コントロール (TComboBox) があります。ExecuteVerb メソッドをオーバーライドし、子コンポーネント (カスタム TListBoxControl) をカスタム TComboBox に追加しようとすると、デザイン時に表示されません。

デフォルトの TComboBox の動作:

デフォルトの 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 はこのモジュールには適用できません

4

1 に答える 1