class CPractice9_2Dlg : public CDialog
{
...
// Dialog Data
//{{AFX_DATA(CPractice9_2Dlg)
...
int m_nData;
//}}AFX_DATA
...
// Generated message map functions
//{{AFX_MSG(CPractice9_2Dlg)
...
afx_msg void OnDeltaposSpinData(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CPractice9_2Dlg::CPractice9_2Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CPractice9_2Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPractice9_2Dlg)
m_nData = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CPractice9_2Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPractice9_2Dlg)
...
DDX_Text(pDX, IDC_EDIT_DATA, m_nData);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPractice9_2Dlg, CDialog)
//{{AFX_MSG_MAP(CPractice9_2Dlg)
...
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_DATA, OnDeltaposSpinData)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
...
void CPractice9_2Dlg::OnDeltaposSpinData(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
// {
if( pNMUpDown->iDelta < 0 )
{
m_nData++;
}
else
{
m_nData--;
}
UpdateData(FALSE);
// }
*pResult = 0;
}