SpinEdit | Active User Change event? lazarus / 31-LCL ---------------------------------------------------------------------- mrmaxmusterman · 2021-09-10 19:11 I have a SpinEdit implemented into my program. I also have an if statement decreasing the value of the spinEdit if the value of it is greater than the length of an input (type string). What i now want to implement is an alert to the User (ShowMessage) if the user reached the max value by himself. In the event that the user deletes parts of the string, i dont want any alerts to occur, just when the user is increasing the spinedit value by him/herself and his the border through my if statement. Is there any way that this could be done? My if statement: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if Count_SpinEdit.Value>length(Input_Edit.Text) then  begin   Count_SpinEdit.Value:=length(Input_Edit.Text);  end; ---------------------------------------------------------------------- Bart · 2021-09-10 20:49 It is totally unlcear to me what you want to achieve. Bart ---------------------------------------------------------------------- mrmaxmusterman · 2021-09-10 20:55 Ok. Let me ask me question in a more direct way then. Is there an event that could be triggered through the user increasing the value of the spinedit through the buttons (increase / decrease) or even through typing in a number? ---------------------------------------------------------------------- Bart · 2021-09-10 20:56 OnChange? Bart ---------------------------------------------------------------------- mrmaxmusterman · 2021-09-10 20:59 Isn’t it technically possible that the onchange event could be triggered through a change in another procedure? E.g. by changing the value of it to the length of an input as in my example? ---------------------------------------------------------------------- Bart · 2021-09-10 21:07 Yes, but since you yourself set this value in your program you can e.g. disable the OnChange before setting the value, or set a flag indicating you programatically changed the value and inspect this in OnChange. The first option seems a bit more fool proof to me: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...  SpinEdit1.OnChange := nil;  SpinEdit1.Value := 123;  SpinEdit1.OnChange := @SpinEdit1Change; //the value it had before, hardcoded in this case  ... Bart ---------------------------------------------------------------------- Bart · 2021-09-11 09:29 Or, without having to hardcode the name of the OnChange event: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  SavedOnChange: TNotifyEvent;begin  SavedOnChange := SpinEdit1.OnChange;  SpinEdit1.OnChange := nil;  SpinEdit1.Value := SpinEdit1.Value + 1;  SpinEdit1.OnChange := SavedOnChange;end; Bart ---------------------------------------------------------------------- wp · 2021-09-11 14:04 When Delphi sets the Modified property is as inconsistent as firing the OnChange event. And since Lazarus must be Delphi-compatible it inherits this annoyance.