LCL: Prevent an exception in TPageControl with a disabled tab. Issue #36282

git-svn-id: branches/fixes_2_0@62850 -
This commit is contained in:
mattias 2020-04-02 11:20:42 +00:00
parent c2436284b0
commit 4ec00f8765

View File

@ -1162,7 +1162,7 @@ begin
if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and
(FPageIndexOnLastChange <> FPageIndex) then
begin
if Assigned(CurPage) and HasFocusedControl(Page[FPageIndexOnLastChange]) then
if Assigned(CurPage) and CurPage.enabled and HasFocusedControl(Page[FPageIndexOnLastChange]) then
CurPage.SetFocus;
Page[FPageIndexOnLastChange].Visible := False;
end;