Moving the Standard Buttons
Posted
by Zafir Anjum
on August 6th, 1998
CRect rectWnd, rectBtn;
GetDlgItem(IDOK)->GetWindowRect(rectBtn);
GetWindowRect(rectWnd);
int btnwidth = rectBtn. rectBtn.Width();
int btnheight = rectBtn.Height();
int offset = rectWnd.bottom - rectBtn.bottom;
int btnleft = rectWnd.right-rectWnd.left;
rectWnd.bottom = rectBtn.top;
rectWnd.right += btnwidth + offset;
MoveWindow(rectWnd);
int ids[] = { IDOK, IDCANCEL, ID_APPLY_NOW };
rectBtn.left = btnleft;
rectBtn.right = btnleft + btnwidth;
for( int i =0; i < sizeof(ids)/sizeof(ids[0]); i++)
{
rectBtn.top = offset + i * (offset+btnheight);
rectBtn.bottom = rectBtn.top + btnheight;
GetDlgItem(ids[i])->MoveWindow(rectBtn);
}

Comments
Another way of moving the buttons
Posted by Legacy on 12/24/2001 12:00amOriginally posted by: Weiye
ReplyHiding and moving the standard propertysheet buttons
Posted by Legacy on 10/09/1998 12:00amOriginally posted by: Colin Johnson
Reply