How does the OnChange event work in AdvEdit? I have AdvEdit as float with validation that must be value > 0. After starting the form, the field lights up red because the value is zero and that's ok. Changing the value in the field to 1 - the OnChange event does not start, even though the field changes color to white (validation is ok). Only the second change in the field, e.g. entering 11, fires the onChange event. Is it normal behavior that in the case of AdvEdit.IsError OnChange does not work?
Are you doing the change programmatically or is it happening with the keyboard?
Using keyboard
I cannot reproduce this. OnChange is triggered here whenever changing the value by keyboard.
Project1.zip (4.8 KB)
Please provide sufficiently detailed information in order to be able to reproduce a problem.
Unfortunately I am still using an old version of Delphi.
But I have a question.
Is it possible to validate a TAdvEdit entry in an OnChange event using the IsError property, controlled by the OnValueValidate event?
The OnValueValidate event is actually specifically designed for that, not sure why you want to do this from OnChange?
Because I want to validate several AdvEdit controls while typing data but not when exiting the control. That is, each time a new character is entered into AdvEdit, it should validate current AdvEdit and change global variable that contains the logical sum of the each AdvEdit.IsError property.That's why I want to do it in the OnChange event.
The global variable IsError should update on every change of each advEdit control
Problem solved. Moving the code in OnValueValidate allowed me to obtain what I wanted. Thank you.