Sometimes I would like to get away from the Borland gray dialogs with the white listboxes. This describes how to create a colored background (you can change) and a listbox with a gray (light gray in this case by whatever color you want) background. Here is such an example. |
There are four things you have to do to color a window. They are:
HBRUSH ColorMe::EvCtlColor (HDC dc, HWND hWndChild, uint ctlType)
{
HBRUSH result;
result = TDialog::EvCtlColor(dc, hWndChild, ctlType);
// INSERT>> Your code here.
if (ctlType == CTLCOLOR_DLG)
result = *_myBrush;
return result;
}
To get the complete code for this program click here.