Moving the Standard Buttons
A better sort of solution is to go thru the child window list and move all children (except perhaps the tab control) Here is code that moves all the controls (other than the tab itself) by a given dx and dy..
// calculate dx and dy to move the controls
// this could correspond to an increase in sheet size
CTabCtrl* pTabCtrl = GetTabControl();
for (CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild =
pChild->GetNextWindow(GW_HWNDNEXT))
{
if (pChild == pTabCtrl) continue;
CRect rectControlWnd;
pChild->GetWindowRect(rectControlWnd);
ScreenToClient(rectControlWnd);
rectControlWnd.top.OffsetRect(dx,dy);
pChild->MoveWindow(rectControlWnd);
}
Because I use this code in a CPropertySheet-derived class that I use to base my own property sheets on, I don't know in advance exactly what control are going to be on the sheet (because some of my other property sheet classes add extra controls). This way ALL my control move to make room.
Another improvement could be to compare the control position of the control to the tab control and only move those controls which are, say, below the tab.

Comments
There are no comments yet. Be the first to comment!