lcl: attempt to fix bug #0013162 (MainForm with several invisible forms restoring produces exception)

git-svn-id: trunk@18662 -
This commit is contained in:
paul 2009-02-13 13:22:07 +00:00
parent 18b9f259d5
commit a0ffd5e9a7

View File

@ -635,10 +635,10 @@ end;
procedure TScreen.RestoreLastActive;
begin
if FLastActiveControl <> nil then
if (FLastActiveControl <> nil) and FLastActiveControl.CanFocus then
FLastActiveControl.SetFocus
else
if FLastActiveCustomForm <> nil then
if (FLastActiveCustomForm <> nil) and FLastActiveCustomForm.CanFocus then
FLastActiveCustomForm.SetFocus;
end;