Skip to content

Commit ccb3b06

Browse files
TylerMSFTTylerMSFT
authored andcommitted
acrolinx
1 parent 9e4ebe3 commit ccb3b06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/mfc/setting-the-dialog-boxs-background-color.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ helpviewer_keywords: ["CSS, background attributes in styles [MFC]", "HTML elemen
88

99
You can set the background color of your dialog boxes by handling `WM_CTLCOLOR` messages for the dialog box window. The color you set is used for only the specified dialog box.
1010

11-
For example, the following code fragment sets the background color of the dialog box to dark grey. The following code imagines a MFC application with an About dialog. The `OnCtlColor` member function is called whenever the dialog box is redrawn:
11+
For example, the following code fragment sets the background color of the dialog box to dark grey. The `OnCtlColor` member function is called whenever the dialog box is redrawn:
1212

1313
```cpp
1414
HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
@@ -18,8 +18,8 @@ HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
1818
```
1919
2020
For the previous code fragment to work:
21-
- add `virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);` to the `protected:` section of the class definition for your dialog
22-
- add the following to the class definition for your dialog and change `CMyDialog` to the name of your dialog class:
21+
- add `virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);` to the `protected:` section of the class definition for your dialog.
22+
- add the following to the class definition for your dialog, and change `CMyDialog` to the name of your dialog class:
2323
2424
```cpp
2525
BEGIN_MESSAGE_MAP(CMyDialog, CDialogEx)

0 commit comments

Comments
 (0)