【问题标题】:TForm property that's an array (or collection) of TFrame descendantsTForm 属性,它是 TFrame 后代的数组(或集合)
【发布时间】:2010-11-29 15:52:49
【问题描述】:

我再次探索this subject,角度与之前略有不同:

我有 TForm 后代,它在其他几个组件中用作对话框,我想将计数的 TFrame 后代数组作为属性添加。

我应该为此使用哪种多项目属性方法? (数组、TList、TObjectList、TCollection、TOwnedCollection 等)。

(我也很想知道概念上的“为什么”)

【问题讨论】:

    标签: delphi custom-component


    【解决方案1】:

    最简单的方法是基于 TCollection。

    在您的 TFrame 周围编写一个 TCollectionItem 后代包装器。

    确保当 TFrame 实例被其他人释放时,您的 TCollectionItem 会收到通知!

    为此使用construction like mentioned here 和here。

    --杰罗恩

    【讨论】:

      猜你喜欢
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-22
      • 1970-01-01
      • 2011-07-31
      • 2019-02-03
      相关资源
      最近更新 更多