Recent

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

pcurtis

  • Hero Member
  • *****
  • Posts: 951
[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 20H2
Laz 2.2.0
FPC 3.2.2

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • 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: 5275
    • 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: 951
Re: Component construction
« Reply #3 on: November 18, 2021, 04:36:45 pm »
OK. Thanks all.
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

 

TinyPortal © 2005-2018