Skip to main content
gamedev.net
🔒 Locked

Edit control

Started by Peter Svensson Dec 5, 2000 at 7:24 PM 1 replies 450+ views
Original Post
Peter Svensson
Peter Svensson
Howdy... Does anyone know how i can color a #@!!¤"% edit control in win32 API? Nothing i do seem to affect it... What i wanna do is... When the user-input is wrong, i want the background to become red. Sounds simple... // Peter - In need of your help!
Peter Svensson
Peter Svensson
Now it works... THanx!

A working piece of code if anyone is interested... Remember to return a brushhandle, otherwise it won''t work.

// Peter - Enjoy!


case WM_CTLCOLOREDIT:

if (lParam == (long) hWndEdit) // Handle to an edit ctrl.
{
SelectObject( (HDC) wParam, hBrush );
SetTextColor( (HDC) wParam, 0xFFFFFF );
SetBkColor( (HDC) wParam, 0x0000FF );

}
return (long) hBrush;


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.