Control Classes
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Control Classes.
Control classes encapsulate a wide variety of standard Windows controls ranging from static text controls to tree controls. In addition, MFC provides some new controls, including buttons with bitmaps and control bars.
The controls whose class names end in "Ctrl" were new in Windows 95 and Windows NT version 3.51.
Static Display Controls
CStatic
A static-display window. Static controls are used to label, box, or separate other controls in a dialog box or window. They may also display graphical images rather than text or a box.
Text Controls
CEdit
An editable-text control window. Edit controls are used to accept textual input from the user.
CIPAddressCtrl
Supports an edit box for manipulating an Internet Protocol (IP) address.
CRichEditCtrl
A control in which the user can enter and edit text. Unlike the control encapsulated in CEdit
, a rich edit control supports character and paragraph formatting and OLE objects.
Controls That Represent Numbers
CSliderCtrl
A control containing a slider, which the user moves to select a value or set of values.
CSpinButtonCtrl
A pair of arrow buttons the user can click to increment or decrement a value.
CProgressCtrl
Displays a rectangle that is gradually filled from left to right to indicate the progress of an operation.
CScrollBar
A scroll-bar control window. The class provides the functionality of a scroll bar, for use as a control in a dialog box or window, through which the user can specify a position within a range.
Buttons
CButton
A button control window. The class provides a programmatic interface for a push button, check box, or radio button in a dialog box or window.
CBitmapButton
A button with a bitmap rather than a text caption.
Lists
CListBox
A list-box control window. A list box displays a list of items that the user can view and select.
CDragListBox
Provides the functionality of a Windows list box; allows the user to move list box items, such as filenames and string literals, within the list box. List boxes with this capability are useful for an item list in an order other than alphabetical, such as include pathnames or files in a project.
CComboBox
A combo-box control window. A combo box consists of an edit control plus a list box.
CComboBoxEx
Extends the combo box control by providing support for image lists.
CCheckListBox
Displays a list of items with check boxes, which the user can check or clear, next to each item.
CListCtrl
Displays a collection of items, each consisting of an icon and a label, in a manner similar to the right pane of File Explorer.
CTreeCtrl
Displays a hierarchical list of icons and labels arranged in a manner similar to the left pane of File Explorer.
Toolbars and Status Bars
CToolBarCtrl
Provides the functionality of the Windows toolbar common control. Most MFC programs use CToolBar instead of this class.
CStatusBarCtrl
A horizontal window, usually divided into panes, in which an application can display status information. Most MFC programs use CStatusBar instead of this class.
Miscellaneous Controls
CAnimateCtrl
Displays a simple video clip.
CToolTipCtrl
A small pop-up window that displays a single line of text describing the purpose of a tool in an application.
CDateTimeCtrl
Supports either an extended edit control, or a simple calendar interface control, that allows a user to choose a specific date or time value.
CHeaderCtrl
Displays titles or labels for columns.
CMonthCalCtrl
Supports a simple calendar interface control that allows a user to select a date.
CTabCtrl
A control with tabs on which the user can click, analogous to the dividers in a notebook.
CHotKeyCtrl
Enables the user to create a hot key combination, which the user can press to perform an action quickly.
CLinkCtrl
Renders marked-up text and launches appropriate applications when the user clicks the embedded link.
CHtmlEditCtrl
Provides the functionality of the WebBrowser ActiveX control in an MFC window.
Related Classes
CImageList
Provides the functionality of the Windows image list. Image lists are used with list controls and tree controls. They can also be used to store and archive a set of same-sized bitmaps.
CCtrlView
The base class for all views associated with Windows controls. The views based on controls are described below.
CEditView
A view that contains a Windows standard edit control.
CRichEditView
A view that contains a Windows rich edit control.
CListView
A view that contains a Windows list control.
CTreeView
A view that contains a Windows tree control.