Recent

Author Topic: [CLOSED] Component construction  (Read 660 times)

pcurtis

  • Hero Member
  • *****
  • Posts: 841
[CLOSED] Component construction
« on: November 18, 2021, 04:15:58 pm »
How can a component tell it was created at runtime or designtime (without passing parameters)?
« Last Edit: November 18, 2021, 04:38:11 pm by pcurtis »
Windows 10
Laz 2.0.12
FPC 3.2.0

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9768
  • FPC developer.
Re: Component construction
« Reply #1 on: November 18, 2021, 04:18:25 pm »
Code: Pascal  [Select][+][-]
  1.  
  2. if csDesigning in ComponentState

Bart

  • Hero Member
  • *****
  • Posts: 4594
    • Bart en Mariska's Webstek
Re: Component construction
« Reply #2 on: November 18, 2021, 04:23:33 pm »
It can tell if it is being created at designtime, not if it was created at designtime  O:-)

Bart

pcurtis

  • Hero Member
  • *****
  • Posts: 841
Re: Component construction
« Reply #3 on: November 18, 2021, 04:36:45 pm »
OK. Thanks all.
Windows 10
Laz 2.0.12
FPC 3.2.0

 

TinyPortal © 2005-2018