You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
procedure TForm1.SynEdit1Change(Sender: TObject);
var
tmp: string;
begin
tmp := StringReplace(Caption, '*', '', [rfReplaceAll]);
if SynEdit1.Modified then tmp := tmp + '*';
if Caption <> tmp then Caption := tmp;
end;
If the user enters something, then a asterisk will be added to the Caption.
If the change is reverted using Ctrl+Z , the asterisk should disappear again, but this does not work because SynEdit1.Modified is true inside the OnChange Event. Modified should be false not true in this case.
However, after the OnChange Event, the Modified flag is set correctly.
So the "dumb" workaround for the issue is checking it with a timer.
procedure TForm1.Timer1Timer(Sender: TObject);
begin
SynEdit1Change(SynEdit1);
end;
The text was updated successfully, but these errors were encountered:
(Addendum: If you fix it, please also verify that the Modification will be true if the user reverts the revert by pressing Ctrl+Y. This might be another case to be considered)
Example code:
If the user enters something, then a asterisk will be added to the Caption.
If the change is reverted using Ctrl+Z , the asterisk should disappear again, but this does not work because
SynEdit1.Modified
is true inside theOnChange
Event.Modified
should be false not true in this case.However, after the OnChange Event, the
Modified
flag is set correctly.So the "dumb" workaround for the issue is checking it with a timer.
The text was updated successfully, but these errors were encountered: