diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index 7f090f6a33..4ab6795d73 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -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;