diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 4d4c0e159f..df2d8b1109 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -106,11 +106,15 @@ bool wxControl::MSWCreateControl(const wxChar *classname, style |= WS_VISIBLE; } + // choose the position for the control int x = pos.x == -1 ? 0 : pos.x, y = pos.y == -1 ? 0 : pos.y, w = size.x == -1 ? 0 : size.x, h = size.y == -1 ? 0 : size.y; + // ... and adjust it to account for ap ossible parent frames toolbar + AdjustForParentClientOrigin(x, y); + m_hWnd = (WXHWND)::CreateWindowEx ( exstyle, // extended style diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 65006bc51b..610126c65c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2994,6 +2994,8 @@ bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos, nonDefault = TRUE; } + AdjustForParentClientOrigin(x, y); + return nonDefault; }