bogieman_
asked on
Don't Execute code in design time
I have made a TComponent decendent, and I want it to skip a certain block of code if it is still in design time in delphi (on the form in delphi, in other words) . At first, I thought I could just look for delphi's TAppbuilder using FindWindow to see if it is running, but then it will never execute the code when delphi is running at the same time. Is there some compiler directive? I've seen alot of {if ...}'s and I don't know if there is one that applies to this. Any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, to slow i see :-)
ASKER
Hmmm...accept kretzschmar or PeterLarsen - you will both have to prove to me that you are worthy of points...
Just give the points to Meikl, he was there first - and he need it :-)
ASKER
I'm sure it works so here are the stinking points.
if csDesigning in YourComponent.ComponentSta
begin
//Enter designtime code here
end
else
begin
//Enter runtimecode here
end;
Regards
Peter