ON_CONTROL_RANGE ON_CONTROL_RANGE( wNotifyCode, id1, id2, memberFxn )ParameterswNotifyCodeThe notification code to which your handler is responding.id1Command ID at the beginning of a contiguous range of control IDs.id2Command ID at the end of a contiguous range of control IDs.memberFxnThe name of the message-handler function to which the controls are mapped. ON_CONTROL_RANGE(BN_CLICKED,ID1,ID10,BT_Click) BT_Click(UINT nID)这个nID就是按下按钮的ID
ON_CONTROL_RANGE( wNotifyCode, id1, id2, memberFxn )ParameterswNotifyCodeThe notification code to which your handler is responding.id1Command ID at the beginning of a contiguous range of control IDs.id2Command ID at the end of a contiguous range of control IDs.memberFxnThe name of the message-handler function to which the controls are mapped.
ON_CONTROL_RANGE(BN_CLICKED,ID1,ID10,BT_Click)
BT_Click(UINT nID)这个nID就是按下按钮的ID
afx_msg void OnBtn(UINT nID);//xxx.cpp
BEGIN_MESSAGE_MAP(CXXX, CDialog) //{{AFX_MSG_MAP(CXXX)
//}}AFX_MSG_MAP ON_CONTROL_RANGE(BN_CLICKED, IDC_BTN01, IDC_BTN10, OnBtn)END_MESSAGE_MAP()void CXXX::OnBtn(UINT nID){
if (nID == IDC_BTN01)
{
//BTN1之响应操作
}
}