Fix sporadic crashes in various calls to [TWinControl].SetFocus, with the new class helper .TrySetFocus

This commit is contained in:
Ansgar Becker
2023-10-16 20:50:10 +02:00
parent 79962b03fc
commit da4a327eee
3 changed files with 30 additions and 14 deletions

View File

@@ -2280,12 +2280,10 @@ begin
listCheckConstraints.EndEditNode;
// Ensure SynMemo's have focus, otherwise Select-All and Copy actions may fail
if PageControlMain.ActivePage = tabCREATEcode then begin
if SynMemoCreateCode.CanFocus then
SynMemoCreateCode.SetFocus;
SynMemoCreateCode.TrySetFocus;
end
else if PageControlMain.ActivePage = tabALTERcode then begin
if SynMemoALTERcode.CanFocus then
SynMemoAlterCode.SetFocus;
SynMemoAlterCode.TrySetFocus;
end;
UpdateSQLcode;
TExtForm.PageControlTabHighlight(PageControlMain);