--- C:/jvcl/run/JvDockVIDStyle.pas	Thu Mar 13 22:44:49 2008
+++ C:/Sandbox/P4D/PythonForDelphi/PythonIDE/JvDockVIDStyle.pas	Thu Mar 13 22:40:04 2008
@@ -1048,0 +1049,5 @@
+              if not JvGlobalDockIsLoading and
+                (TJvDockTabHostForm(Host).GetActiveDockForm <> nil) and
+                GetParentForm(Host).Visible and
+                TJvDockTabHostForm(Host).GetActiveDockForm.CanFocus then
+                   TJvDockTabHostForm(Host).GetActiveDockForm.SetFocus;
@@ -1139,0 +1145,5 @@
+    if (ControlCount > 0) and Assigned(Controls[0]) and (Controls[0] is TJvDockTabHostForm) then begin
+      with TJvDockTabHostForm(Controls[0]) do
+        if (GetActiveDockForm <> nil) and GetActiveDockForm.CanFocus then
+          GetActiveDockForm.SetFocus;
+    end;
@@ -2598,0 +2609,5 @@
+  with ActivePage do
+    if not JvGlobalDockIsLoading and (ControlCount > 0) and Assigned(Controls[0]) then begin
+      if Visible and (Controls[0] <> nil) and (Controls[0] as TWinControl).CanFocus then
+          (Controls[0] as TWinControl).SetFocus;
+    end;
@@ -3273,6 +3287,0 @@
-      if Assigned(Page.ActivePage) and Page.ActivePage.CanFocus then
-      begin
-        AParentForm := GetParentForm(Page);
-        if Assigned(AParentForm) then
-          AParentForm.ActiveControl := Page.ActivePage;
-      end;
@@ -3284,0 +3294,8 @@
+    end;
+    if Assigned(Page.ActivePage) and Page.ActivePage.CanFocus then
+    begin
+      AParentForm := GetParentForm(Page);
+      if Assigned(AParentForm) then begin
+        Page.SelectFirst;
+        AParentForm.SetFocus;
+      end;
