TrackBar is calling OnChange between user and software changes. lazarus / 31-LCL ---------------------------------------------------------------------- jamie · 2022-11-19 17:25 I know that I can nullify the event handler, but I don't think that should be done, its just bad patch coding.  Way back I ported an app from Delphi over to here and it has a few TrackBar's in it. I had to put in a hack to determine if the user or software was changing the value.  Apparently, my old Delphi Install does not call the OnChange handler when software setting the value via Position, for example.  I don't have my latest Delphi in front of me at the moment, can someone verify if Current Delphi ignores the event when software setting the value?  In any case, if it is desirable to keep the OnChange event operating always then maybe we should have a MODIFIED property in there that can be tested while in that event? Cleared when software modifieds it, SET otherwise if user changes the value, like a few other controls that have it now.  The Modified flag is nice because If wanted to reset the value to something different while in the OnChange handler I can test the MODIFIED value which may actually cause a re-entry to the Event. That test can abort before doing damage.  Waiting for comments. ---------------------------------------------------------------------- MarkMLl · 2022-11-19 21:19 I've been working on something that had a /lot/ of software updates between components, and used a non-zero tag to inhibit event loops. There were definitely situations where I wanted a "changed" event to fire, but I definitely had to inhibit overenthusiastic propagation. MarkMLl ---------------------------------------------------------------------- jamie · 2022-11-19 21:30 What I am suggesting does not cancel the event, it will still get called but there will be a flag in there as a MODIFIED property where it can be tested to know how the event got there. FALSE = Software change TRUE for User moving the slider.  Currently I had to place the hack in there because it will causing destructive damage to my setup files for updating items because a change at one slider meant that I had to change a few other things, too!  This idea does not change any current state of the control, it just adds to its quality.  Maybe If I have time, I can wedge a property in there and submit it.