How I change the background color on a read only edit box?
Printable View
How I change the background color on a read only edit box?
juz detect the WM_CTLCOLORSTATIC message inside the WndProc will do...
regards,PHP Code:case WM_CTLCOLORSTATIC:
// Change the static control background color
// Ref.
// wParam - handle to static control DC (HDC)
// lParam - handle to static control handle (HWND)
if ((HWND)lParam == hWndEdit1)
{
// Change text color
SetTextColor((HDC)wParam, RGB(255, 0, 255));
// Change background color
SetBkMode((HDC)wParam, TRANSPARENT);
return (long)hBrush2;
}
break;
Thanks it worked great after I figured out what hBrush was doing.
lol... the return hBrush is important.