Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 20: List-Based Controls Visual C++ and MFC Fundamentals


IDC_CHK_TOMATO m_bTomato IDC_CHK_PICKLES m_bPickles


  1. Display the main dialog box (Customer Menu)

  2. In the top section inside the Ingredients group box, add a check box

  3. Set the ID of the new control to IDC_CHK_REGULARS

  4. Change its Caption to &Regulars

  5. Set its Left Text property to True or checked

  6. Set its Tri-State property to True

  7. Complete the design of the dialog box as follows:


Control ID Caption Other Property
Group Box Ingredients Ingredients
Check Box IDC_CHK_REGULARS &Regulars Left Text = True
Check Box IDC_CHK_SWEETENER &Sweetener Left Text = True
Check Box IDC_CHK_CHEESE C&heese Left Text = True
Check Box IDC_CHK_BACON B&acon Left Text = True
Group Box Don’t Care Options
Button IDC_INGREDIENTS &Ingredients
Radio Button IDC_OPTIONS &Mayonnaise Group = True
Left Text = True
Radio Button IDC_KETHUP &Ketchup Left Text = True
Radio Button IDC_MUSTARD Mus&tard Left Text = True
Picture Color = Etched
Modal Frame = True
Static Total Price:
Edit Box IDC_TOTAL_PRICE Align Text = Right


  1. Add a Control variable for all non-IDC_STATIC controls with the following names:


ID Control Variable ID Control Variable
IDC_BREAD m_Bread IDC_MEAT M_Meat
IDC_REGULARS m_Regulars IDC_SWEETENER m_Sweetener
IDC_CHEESE m_Cheese IDC_BACON m_Bacon
Free download pdf