Article ID: 143210
Article Last Modified on 11/21/2006
/* Compile options needed: Default
*/
BOOL CMyWizardSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CRect rect, tmp;
CSize shift;
CWnd* pTemp;
CWnd* pNext;
// Get The position of the Cancel Button
pTemp = GetDlgItem(IDCANCEL);
if (pTemp==NULL)
return bResult;
pTemp->GetWindowRect(tmp);
// Get The position of the Next Button
pNext = GetDlgItem(ID_WIZNEXT);
if (pNext==NULL)
return bResult;
pNext->GetWindowRect(rect);
// Calculate the distance to shift the Next and Back buttons
shift.cx = tmp.left-rect.right+rect.Width();;
shift.cy = 0;
// Get The position of the Back Button
pTemp = GetDlgItem(ID_WIZBACK);
if (pTemp==NULL)
return bResult;
pTemp->GetWindowRect(tmp);
// move the Back button
tmp -= shift;
ScreenToClient(tmp);
pTemp->MoveWindow(tmp);
// move the Next button
ScreenToClient(rect);
tmp = rect-shift;
pNext->MoveWindow(tmp);
// Show the Finish Button
pTemp = GetDlgItem(ID_WIZFINISH);
if (pTemp==NULL)
return bResult;
pTemp->ShowWindow(SW_SHOW);
return bResult;
}
Additional query words: 4.00 CPropertyPage CPropertySheet
Keywords: kbhowto kbpropsheet kbuidesign KB143210