Visual C++ and MFC Fundamentals Chapter 17: Track-Based Controls
- Display the new dialog box, right-click the Suggested Username edit box and click
Add Variable - Set the Variable Name to m_StrUsername
- Set its Category to Value
- Set the Maximum Characters to 5
- Add control and value variables to the controls as follows:
Control ID Control
Variable
Value Variable Max
Chars
Edit Box IDC_FULL_NAME m_StrFullName
Edit Box IDC_USERNAME m_Username m_StrUsername 5
Edit Box IDC_PASSWORD m_Password m_StrPassword 14
Edit Box IDC_CONF_PASSWORD m_StrConfPassword
- Display the main form.
- Add a button under the Web Site edit box and its Caption to Account Setu&p
- Change the Identifiers of the edit boxes and the button from left to right and from top
to bottom as follows: IDC_DATE_HIRED, IDC_EMPLOYEE_NBR,
IDC_FIRST_NAME, IDC_MI, IDC_LAST_NAME, IDC_ADDRESS, IDC_SUITE,
IDC_CITY, IDC_STATE, IDC_ZIP_CODE, IDC_HOME_PHONE,
IDC_WORK_PHONE, IDC_EMAIL_ADDRESS, IDC_WEB_SITE,
IDC_BTN_ACCOUNT - Set the Disabled property of the Account Setup button to True
- Set the Uppercase of the MI edit box to True
- Add some CString value and a CButton Control variables to the controls as follows:
Control Identifier Value Variable Control Variable Max Chars
Edit Box IDC_FIRST_NAME m_StrFirstName
Edit Box IDC_MI m_StrMI 1
Edit Box IDC_LAST_NAME m_StrLastName
Button IDC_BTN_ACCOUNT m_BtnAccount
- Add a BN_CLICKED Event Handler to the button associated with the view class
and implement it as follows: