Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

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


14.1 Handling Controls.......................................................................................


14.1.1..Introduction..........................................................................................


There are two particularly important pieces of information about every control of your
application. The information stored in the control and the action or type of action the user
can perform on that control. At its most basic level, at one time in the life of an
application, a control holds a value that can be of particular interest either to you or to the
user. On the other hand, when interacting with the computer, based on your application,
the user will usually face different types of controls that do various things and produce
different results. These are two features of controls (their values and the actions the user
can perform on them) that you should know as much as possible, about the controls you
choose to involve in your application.

Practical Learning: Introducing Controls Variables



  1. Open the Geometry application. If you do not have it, open the Geometry1
    application from the accompanying exercises of this book

  2. Test the application to make sure it is working fine. Then close it and return to
    MSVC

  3. Click the Resourve View tab, expand the Dialog folder and double-click
    IDD_QUADRILATERAL. Delete the existing control on the dialog box

  4. On the Controls toolbox, click the Custom Control button and click in the top
    center section of the dialog box. On the Properties window:
    Change its ID to IDC_LBL_SSIDE
    Set its Caption to &Side:
    Set the Class name as Static

  5. Using only the Custom Control object, design the rest of the property page as follows
    (the controls are listed from left to right then from up -> down):


ID Caption Class Style ExStyle
Free download pdf