【问题标题】:Component Initialization - Runtime vs. Designtime组件初始化 - 运行时与设计时
【发布时间】:2010-10-16 01:46:33
【问题描述】:

我正在构建一系列视觉复合组件,它们使用类似/常见的“连接”方法,在内部表等启动。

我正在自动化一些连接内容以在运行时自动连接。如何在组件级别判断当前状态是运行时还是设计时?

【问题讨论】:

    标签: delphi custom-component


    【解决方案1】:

    我想您想检查组件的ComponentState 属性中是否存在csDesigning 标志:

    if csDesigning in ComponentState then
      // designtime
    else
      // not designtime
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-06
      • 1970-01-01
      • 2019-01-24
      • 2020-12-18
      • 2019-04-28
      相关资源
      最近更新 更多