diff --git a/samples/xrc/rc/objref.xrc b/samples/xrc/rc/objref.xrc
index 03876e6a98..7028045d69 100644
--- a/samples/xrc/rc/objref.xrc
+++ b/samples/xrc/rc/objref.xrc
@@ -80,6 +80,7 @@
diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp
index 9e3d23d2ff..6a7e591bb3 100644
--- a/src/xrc/xh_sizer.cpp
+++ b/src/xrc/xh_sizer.cpp
@@ -256,7 +256,16 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
m_isInside = true;
m_isGBS = (m_class == wxT("wxGridBagSizer"));
- CreateChildren(m_parent, true/*only this handler*/);
+ wxObject* parent = m_parent;
+#if wxUSE_STATBOX
+ // wxStaticBoxSizer's child controls should be parented by the box itself,
+ // not its parent.
+ wxStaticBoxSizer* const stsizer = wxDynamicCast(sizer, wxStaticBoxSizer);
+ if ( stsizer )
+ parent = stsizer->GetStaticBox();
+#endif // wxUSE_STATBOX
+
+ CreateChildren(parent, true/*only this handler*/);
// set growable rows and cols for sizers which support this
if ( wxFlexGridSizer *flexsizer = wxDynamicCast(sizer, wxFlexGridSizer) )