If you're using our Windows Forms products, there is no problem to add our controls to your form: just drag the required item from the Visual Studio
toolbox and drop it into the form. But unfortunately, a life of MFC developers is not so easy: adding a non-standard control to the dialog requires some steps.
In this walkthrough we'll try to describe how to do this task. If you don't have enough experience with Visual C++/MFC, please take a look at the
following information:
Control |
How to add |
CBCGPAnalogClockCtrl
Control with embedded analog clock gauge.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPAnalogClockCtrl in .H file
|
CBCGPAnimCtrl
Control that displays a
set of bitmaps with specified frame rate.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPAnimCtrl in .H file
|
CBCGPButton
Control that provides
the extended functionality of the standard Windows button controls. It
includes the new look & feel styles, the various ways to align text,
ability to combine an image and text, set cursor and tooltip.
|
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPButton in .H file
|
CBCGPBrushButton
Brush button is derived
from the regular pushbutton control and displays a brush preview on
left. When user clicks this button, modal brush edit dialog appears.
|
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPBrushButton in .H file
|
CBCGPBreadcrumb
Control that allows the
user to explore hierarchical data, such as application-defined libraries
or file directories. It may be compared to the tree-view control that
does not show the whole items tree at once.
|
- Add an Edit control to your dialog box (1)
- Define CEdit member variable for this control (2)
- Replace CEdit with CBCGPBreadcrumb in .H file
|
CBCGPCalculator
Control that implements
the functionality of an arithmetical calculator.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPCalculator member variable to the dialog class (e.g,
m_wndCalc)
- Create control in OnInitDialog: m_wndCalc.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPCalendar
Control that implements
the functionality of calendar control. The control can display several
months at once. The number of months to display is calculated
automatically, according to the control size.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPCalendar member variable to the dialog class (e.g,
m_wndCalendar)
- Create control in OnInitDialog: m_wndCalendar.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPChartCtrl
Control that
encapsulates a Chart visual object, which covers the control's client
area.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPChartCtrl in .H file
|
CBCGPCheckListBox
Extended checked list box
control with visual theme, captions and "pinned" items support
|
- Add a List box to your dialog box (1). This control should have "owner-draw" and "has strings" styles.
- Define CListBox member variable for this control (2)
- Replace CListBox with CBCGPCheckListBox in .H file
|
CBCGPCircularGaugeCtrl
Control with embedded
circular gauge.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPCircularGaugeCtrl in .H file
|
CBCGPCircularProgressIndicatorCtrl
Control with embedded
circular progress indicator.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPCircularProgressIndicatorCtrl in .H file
|
CBCGPColorBar
Office-style color
palette.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPColorBar member variable to the dialog class (e.g,
m_wndColorBar)
- Create control in OnInitDialog: m_wndColorBar.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPColorButton
Office-style color
picker.
|
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPColorButton in .H file
|
CBCGPColorComboBox
Control that implements
an owner-draw combo box with drop-down list that contains color names
with a color box on the left.
|
- Add a Combo box to your dialog box. This control should have "drop list", "owner-draw" and "has strings" styles.
- Define CComboBox member variable for this control (2)
- Replace CComboBox with CBCGPColorComboBox in .H file
|
CBCGPComboBox
Control that implements
a drawing of a combo box control using Visual Theme. It's also designed
to support drawing on "Aero Glass".
|
- Add a Combo box to your dialog box. This control should have "owner-draw" and "has strings" styles.
- Define CComboBox member variable for this control (2)
- Replace CComboBox with CBCGPComboBox in .H file
|
CBCGPDateTimeCtrl
Date/time picker |
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPDateTimeCtrl in .H file
|
CBCGPDateTimeList
Date/time list |
-
Add invisible empty Picture control (placeholder) to the Dialog Editor (1)
-
Add CBCGPDateTimeList member variable to the dialog class (e.g, m_wndDateTimeList)
- Create control in OnInitDialog: m_wndDateTimeList.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPDurationCtrl
Time duration control |
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPDurationCtrl in .H file
|
CBCGPDiagramVisualContainerCtrl
Diagram container control
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPDiagramVisualContainerCtrl in .H file
|
CBCGPEdit
Edit control with a
browse button and search box functionality.
|
- Add an Edit control to your dialog box (1)
- Define CEdit member variable for this control (2)
- Replace CEdit with CBCGPEdit in .H file
|
CBCGPEditCtrl
Advanced edit control
with syntax highlighting, markers, outlining (collapsible nodes) and
IntelliSense support.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPEditCtrl member variable to the dialog class (e.g,
m_wndEdit)
- Create control in OnInitDialog: m_wndEdit.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPEditListBox
Editable list box with a caption and "New", "Delete", "Up" and "Down" buttons.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPEditListBox in .H file
|
CBCGPFontComboBox
Font picker control |
- Add a Combo box to your dialog box. This control should have "owner-draw" and "has strings" styles.
- Define CComboBox member variable for this control (2)
- Replace CComboBox with CBCGPFontComboBox in .H file
|
CBCGPGridCtrl
Advanced grid and report control.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPGridCtrl member variable to the dialog class (e.g,
m_wndGrid)
- Create control in OnInitDialog: m_wndGrid.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPGroup
Themed group box with optional check box/radio button.
|
- Add a Group box to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPGroup in .H file
|
CBCGPHotSpotImageCtrl
Control with background image containing clickable rectangular areas (hot spots). When the user clicks a hot spot,
the control sends the WM_COMMAND message with BN_CLICKED code to the parent.
|
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPHotSpotImageCtrl in .H file
|
CBCGPInfoBoxCtrl
Control that implements an enhanced static text box with caption, icon, color bar and link.
|
- Add a Static text to your dialog box (1)
- Define CStatic member variable (e.g., m_wndInfoBox) for this control (2)
- Replace CStatic with CBCGPInfoBoxCtrl in .H file
|
CBCGPKnobCtrl
Control that emulates the digital knob functionality.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable (e.g., m_wndKnob) for this control (2)
- Replace CStatic with CBCGPKnobCtrl in .H file
|
CBCGPLinearGaugeCtrl
Control with embedded linear gauge.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPLinearGaugeCtrl in .H file
|
CBCGPLineStyleComboBox
A combo box with predefined set of line styles such as solid, dot or dash.
|
- Add a Combo box to your dialog box (1). This control should have "owner-draw" and "has strings" styles.
- Define CComboBox member variable for this control (2)
- Replace CComboBox with CBCGPLineStyleComboBox in .H file
|
CBCGPListBox
Extended list box control with visual theme, captions and "pinned" items support.
|
- Add a List box to your dialog box (1). This control should have "owner-draw" and "has strings" styles.
- Define CListBox member variable for this control (2)
- Replace CListBox with CBCGPListBox in .H file
|
CBCGPListCtrl
Extended list control with visual theme support. |
- Add a List control to your dialog box (1)
- Define CListCtrl member variable for this control (2)
- Replace CListCtrl with CBCGPListCtrl in .H file
|
CBCGPMaskEdit
Extended edit control
that is able to validate typed characters against the specified mask and
display them according to specified template.
|
- Add an Edit control to your dialog box (1)
- Define CEdit member variable for this control (2)
- Replace CEdit with CBCGPMaskEdit in .H file
|
CBCGPMenuButton
Control that provides
the functionality of button that shows popup menu when clicked and
redirects a selected command to the parent.
|
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPMenuButton in .H file
|
CBCGPProgressCtrl
Extended progress control with visual theme support. |
- Add a Progress control to your dialog box (1)
- Define CProgressCtrl member variable for this control (2)
- Replace CProgressCtrl with CBCGPProgressCtrl in .H file
|
CBCGPPropertySheetCtrl
Property sheet control. |
- Add invisible empty Picture control (placeholder) to your dialog box (1)
- Add CBCGPPropertySheetCtrl member variable to the dialog class (e.g, m_wndPropSheet)
- Add control initialization code to your OnInitDialog:
m_wndPropSheet.m_bIsAutoDestroy = FALSE;
m_wndPropSheet.CreateOnPlaceHolder(
this,
id_of_placeholder,
id_of_control, style);
|
CBCGPPropList
Advanced property grid
control with embedded toolbar, search box, multi-level hierarchy, item
states, commands and descriptions.
|
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPPropList member variable to the dialog class (e.g,
m_wndPropList)
- Create control in OnInitDialog: m_wndPropList.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPRotationCtrl
Rotation control is
derived from Radial menu and intended for 3D object (such as charts in
3D) views.
|
- Add empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPRotationCtrl in .H file
|
CBCGPRadialMenu
Radial menu control |
- Add empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPRadialMenu in .H file
|
CBCGPScrollBar
Scroll bar control with
visual theme support.
|
- Add a Scroll bar to your dialog box (1)
- Define CScrollBar member variable for this control (2)
- Replace CScrollBar with CBCGPScrollBar in .H file
|
CBCGPShellBreadcrumb
Explorer-style shell breadcrumb control.
|
-
Verify that you added a call to "InitShellManager();" at the beginning of your
application InitInstance()
- Add an Edit control to your dialog box (1)
- Define CEdit member variable for this control (2)
- Replace CEdit with CBCGPShellBreadcrumb in .H file
|
CBCGPShellList
Explorer-style shell list control.
|
-
Verify that you added a call to "InitShellManager();" at the beginning of your
application InitInstance()
- Add a List control to your dialog box (1)
- Define CListCtrl member variable for this control (2)
- Replace CListCtrl with CBCGPShellList in .H file
|
CBCGPShellTree
Explorer-style shell tree view.
|
-
Verify that you added a call to "InitShellManager();" at the beginning of your
application InitInstance()
- Add a Tree control to your dialog box (1)
- Define CTreeCtrl member variable for this control (2)
- Replace CTreeCtrl with CBCGPShellTree in .H file
|
CBCGPSpinButtonCtrl
Spin ("up/down") control with visual theme support.
|
- Add a Spin ("up/down") control to your dialog box (1)
- Define CSpinButtonCtrl member variable for this control (2)
- Replace CSpinButtonCtrl with CBCGPSpinButtonCtrl in .H file
|
CBCGPStatic
Static control with visual theme support.
|
- Add a static control to your dialog box
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPStatic in .H file
If control has a default (IDC_STATIC) ID, you don't have to add this variable.
|
CBCGPSwitchCtrl
"On/Off" gauge with a different shapes and visual themes.
|
- Add an empty Picture control (placeholder) to your dialog box
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPSwitchCtrl in .H file
|
CBCGPTabCtrl
Themed Tab control. |
- Add a Tab control to your dialog box
- Define CTabCtrl member variable for this control (2)
- Replace CTabCtrl with CBCGPTabCtrl in .H file
|
CBCGPTabWnd
The advanced tab control provides the functionality that allows to create tabbed widgets. |
-
Add invisible empty Picture control (placeholder) to the
Dialog Editor (1)
-
Add CBCGPTabWnd member variable to the dialog class (e.g,
m_wndTab)
- Create control in OnInitDialog: m_wndTab.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPTagCloudCtrl
Tag Cloud control is a
visual representation for text data ("tags") and the importance of each
tag is shown with font size or color.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPTagCloudCtrl in .H file
|
CBCGPTextGaugeCtrl
Text Gauge control is a static text label.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPTextGaugeCtrl in .H file
|
CBCGPTreeCtrl
Tree control with visual theme support.
|
- Add a Tree control to your dialog box (1)
- Define CTreeCtrl member variable for this control (2)
- Replace CTreeCtrl with CBCGPTreeCtrl in .H file
|
CBCGPTreeCtrlEx
Extended Tree Control with multiple columns, filter bar and visual theme support. |
- Add invisible empty Picture control (placeholder) to the Dialog Editor (1)
- Add CBCGPTreeCtrlEx member variable to the dialog class (e.g, m_wndTree)
- Create control in OnInitDialog: m_wndTree.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPTreeMapCtrl
Tree map is a space-constrained visualization of hierarchical structures. It shows attributes of leaf nodes using size and colors.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPTreeMapCtrl in .H file
|
CBCGPURLLinkButton
Hyperlink control. |
- Add a Button to your dialog box (1)
- Define CButton member variable for this control (2)
- Replace CButton with CBCGPURLLinkButton in .H file
|
CBCGPVisualContainerCtrl
Gauges/charts and other visual objects container control
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPVisualContainerCtrl in .H file
|
CBCGPWebView2Ctrl
Microsoft Edge WebView2 wrapper control.
|
- Add invisible empty Picture control (placeholder) to the Dialog Editor (1)
- Add CBCGPWebView2Ctrl member variable to the dialog class (e.g, m_wndWebView)
- Create control in OnInitDialog: m_wndWebView.CreateOnPlaceHolder(this, id_of_placeholder, id_of_control, style);
|
CBCGPWinUITilesCtrl
Control that implements Windows 8/10-like tiles.
|
- Add an empty Picture control (placeholder) to your dialog box (1)
- Define CStatic member variable for this control (2)
- Replace CStatic with CBCGPWinUITilesCtrl in .H file
|
If your working environment is Visual C++ 6.0, Visual Studio 2010 or later,
the easiest way to do it is using MFC Class Wizard:
In other Visual Studios versions (such as Visual Studio 2005 or 2008) you can
use "Add Variable" context menu item: