Visual C++ and MFC Fundamentals Chapter 17: Track-Based Controls
ability to control this behavior is set by changing the Wrap property to True or by adding
the UDS_WRAP style. This behavior applies also if the value has been fully
decremented.
Practical Learning: Designing an UpDown control
- Arrange the tab sequence as follows:
- Click one of the spin buttons to select it. Then press and hold Ctrl. Click the other
two spin buttons to select them, and release Ctrl - On the Properties window, click the arrow of the Alignment combo box and select
Right - Check the Auto Buddy check box or set its value to True
- Check the Set Buddy Integer check box or set its value to True
- Test the application
- Close the dialog box and return to MSVC
17.1.4..Methods of Managing an UpDown Control...................................
We have already mentioned that a spin button is based on the CSpinButtonCtrl class.
This class is equipped with a default constructor used to declare a CSpinButtonCtrl
variable or pointer and the Create() method used to initialize the control. Here is an
example:
BOOL CSpinDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CSpinButtonCtrl *SpinCtrl = new CSpinButtonCtrl;
SpinCtrl->Create(WS_CHILD | WS_VISIBLE | UDS_SETBUDDYINT,
CRect(60, 10, 80, 35), this, 0x128);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE