MoveWindow (rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
// Convert to client coordinates
ScreenToClient (&rc);
// m_Button is of type CButton and is a member of CMyPropertySheet
m_Button.Create ("&MyButton", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
CRect (14, rc.bottom-30, 14+75, rc.bottom-30 + 21),
this, IDC_MYBUTTON);
//...
}
4、添加消息映射
BEGIN_MESSAGE_MAP(CMyPropertySheet, CPropertySheet)
//{{AFX_MSG_MAP(CMyPropertySheet)
// NOTE - the ClassWizard will add and remove mapping macros here.
//...
ON_COMMAND(IDC_MYBUTTON, OnMyButton)
//...
//}}AFX_MSG_MAP
END_MESSAGE_MAP()