I remember fixing a high CPU toggling the Enabled
property in an OnUpdate
even handler on a TCustomAction
descendant quite some time ago, but wasn’t completely sure of the exact cause.
My fix was to only set it once every clock tick (about every 20 milliseconds).
The best fix would have been not to toggle at all: just calculate the right result, then only set the Enabled
property once: [WayBack] Updating Actions (Don’t Do This) – Dave’s Development Blog
–jeroen