Visual C++ and MFC Fundamentals Chapter 17: Track-Based Controls
- Change their IDs to IDB_ELANTRA, IDB_ESCAPE, IDB_ESCORT, IDB_FOCUS,
IDB_MARQUIS, IDB_MYSTIQUE, IDB_NAVIGATOR, IDB_SENTRA, and
IDB_SEPHIA respectively - Add a Picture control to the middle side of the dialog box and change its ID to
IDC_PREVIEW - Set its Type to Bitmap and set its Bitmap to IDB_CIVIC
- Add a Control variable for the picture control and name it m_Picture
- Complete the dialog design as follows:
- Set the IDs of the edit boxes from top to bottom to IDC_MAKE, IDC_MODEL,
IDC_YEAR, and IDC_DOORS - Add a Value control to each edit box and name them m_Make, m_Model, m_Year,
and m_Doors respectively - To store the values for the controls on the dialog box, in the header file of the dialog
box, create a structure named LisOfCars and declare a private array for it in the
dialog’s class as follows:
// CarInventory1Dlg.h : header file
//
#pragma once
// A class for each car
struct CListOfCars
{
CString Make;
CString Model;
UINT CarYear;
UINT Doors;
UINT CarPicture;
};
// CCarInventory1Dlg dialog
class CCarInventory1Dlg : public CDialog
{
// Construction
public:
CCarInventory1Dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data