Click to See Complete Forum and Search --> : Text color problems


Bi0Mutati0n
February 21st, 2005, 07:00 PM
I was changing the background and text colors for my controls and when I place the code for changing the color of text in a multiline edit control, the text gets all screwed up when I scroll up or down.

This code works fine on all the other controls just not the multiline edit controls:

case WM_CTLCOLORSTATIC: {
if((HWND)lParam == hChanName) {
SetTextColor((HDC)wParam, RGB(255, 255, 255));
SetBkMode((HDC)wParam, TRANSPARENT);
return (LONG)g_hbrBackground;
}
if((HWND)lParam == hEdit) { // Read only multiline edit control
SetTextColor((HDC)wParam, RGB(255, 255, 255));
SetBkMode((HDC)wParam, TRANSPARENT);
return (LONG)g_hbrBackground;
}
} break;


What should I do to fix this?

ovidiucucu
February 22nd, 2005, 04:22 AM
Remove SetBkMode((HDC)wParam, TRANSPARENT); and replace with
SetBkColor((HDC)wParam, RGB(...same color as the brush...));

Bi0Mutati0n
February 22nd, 2005, 10:51 AM
Now it works. Thanks!