MFC interface development: an article to teach you how to use BCG to add Visual Manager support to the dialog box

The BCGControlBar library has more than 500 MFC extension classes that have been fully designed, tested and fully documented. Our components can be easily integrated into your application and save you hundreds of development and debugging time.

BCGControlBar v30.5 official version download

If you need to apply the currently selected Visual Manager to an existing dialog (form view or property page), you must make the following changes in the source code:

1. Change the parent (base) class name: You must make the following substitutions in the .h and .cpp files:

  • CDialog - CBCGPDialog.
  • CPropertySheet - CBCGPPropertySheet.
  • CPropertyPage - CBCGPPropertyPage.
  • CFormView - CBCGPFormView.

2. Call EnableVisualManager in the constructor of the dialog box class (as far as the property sheet is concerned, it is enough to call this method only in the class constructor derived from CBCGPPropertySheet: all pages will be automatically themed).

3. If some controls on the dialog box have been associated with control member variables (such as CButton or CEdit), you must replace the MFC class name with the corresponding library name. If the control has no member variables, it will automatically set the theme.

4. If the dialog box contains a list box or combo box control, you must change its style to owner-draw + "Has strings" and add CBCGPListBox / CBCGPComboBox variables for these controls (due to Windows limitations, the mentioned styles are in the list The box/combo box cannot be changed after it has been created), so we cannot make this change.

For example, if you perform all the above steps on the following MFC dialog:

BCGControlBar tutorial

The result will be:

BCGControlBar tutorial

(VS 2017 blue theme)

BCGControlBar tutorial

(VS 2017 dark theme)

BCGControlBar tutorial

(Office 2016 colorful theme)


Huidu high-end UI interface development

Guess you like

Origin blog.csdn.net/AABBbaby/article/details/108507799