Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows



  1. Change the design of the IDR_MAINFRAME icon as follows:

  2. Display the dialog box


11.3.3..The Control's Class Name..................................................................


To create a control, you must specify its name. To do this, you have various options. The
Win32 library provides already defined names of classes you can use to create a control.
These classes are:

Class Name Description
STATIC A static control can be used to display text, a drawing, or a
picture
EDIT As it name suggests, an edit control is used to display text to the
user, to request text from the user, or both
RichEdit Like an edit box, a rich edit control displays text, requests it, or
does both. Besides all the capabilities of the edit control, this
control can display formatted text with characters or words that
use different colors or weight. The paragraphs can also be
individually aligned. The RichEdit class name is used to create a
rich edit control using the features of Release 1.0 of its class
RICHEDIT_CLASS This control is used for the same reasons as the RichEdit class
name except that it provides a few more text and paragraph
formatting features based on Release 2.0
LISTBOX A list box is a control that displays items, such as text, arranged
so each item, displays on its own line
COMBOBOX A combo box is a combination of an edit control and a list box.
It holds a list of items so the current selection displays in the edit
box part of the control
SCROLLBAR A scroll bar is a rectangular object equipped with a bar
terminated by an arrow at each end. It is used to navigate left
and right or up and down on a document
BUTTON A button is an object that the user clicks to initiate an action
MDICLIENT This class name is used to create a child window frame for an
MDI application

To use one of these classes, you have various options. At design time, on the Controls

toolbox, you can click the Custom Control button and click the dialog box or form.
Free download pdf