Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 15: Fundamental Controls Visual C++ and MFC Fundamentals



  1. Change the IDs, captions and styles of the controls as follows (from left to right and
    up -> down):


ID Caption Class Style ExStyle
IDC_LBL_USIDE &Side: Static 0 x50010000 0x0
IDC_EDT_USIDE Edit 0x50810000 0x0
IDC_BTN_UCALC &Calculate Button 0x50010000 0x0
IDC_LBL_UAREA &Area: Static 0x50010000 0x0
IDC_EDT_UAREA Edit 0x50810000 0x1
IDC_LBL_UVOL &Volume: Static 0x50010000 0x0
IDC_EDT_UVOL Edit 0x50800000 0x 1
IDC_LBL_BLENGTH &Length: Static 0x50010000 0x0
IDC_EDT_BLENGTH Edit 0x50810000 0x0
IDC_LBL_BHEIGHT &Height: Static 0x50010000 0x0
IDC_EDT_BHEIGHT Edit 0x50810000 0x0
IDC_LBL_BWIDTH &Width Static 0x50010000 0x0
IDC_EDT_BWIDTH Edit 0x50810000 0x0
IDC_BTN_BCALC Calc&ulate Button 0x50010000 0x0
IDC_LBL_BAREA A&rea: Static 0x50010000 0x1
IDC_EDT_BAREA Edit 0x50810000 0x1
IDC_LBL_BVOL V&olume: Static 0x50010000 0x0
IDC_EDT_BVOL Edit 0x50810000 0x0


  1. Close MSVC completely. When asked to save, click Yes as many times as you are
    asked.


14.1.2..Control's Control Variables:..............................................................


After visually adding a control to your application, if you want to refer to it in your code,
you can declare a variable based on, or associated with, that control. The MFC library
allows you to declare two types of variables for some of the controls used in an
application: a value or a control variables.

A control variable is a variable based on the class that manages the control. For example,
a static control is based on the CStatic class. Therefore, if you add a static control to your
Free download pdf