Just wondering - is it possible to use colored text in an edit box? If not, can it be hardcoded? Thanks :D !
Printable View
Just wondering - is it possible to use colored text in an edit box? If not, can it be hardcoded? Thanks :D !
Handle the WM_CTLCOLOREDIT message. :)
wParam: handle to the device context for the edit control window.
lParam: handle to the edit control.
Example
Code:case WM_CTLCOLOREDIT:
{
HDC dc = (HDC)wParam ;
SetTextColor( dc, RGB(255,0,0) ) ; // red text
SetBkMode( dc, TRANSPARENT) ; // choose our own bkgrnd
return (int)(HBRUSH)GetStockObject(GRAY_BRUSH) ; // gray
}
Does this go in WM_COMMAND, WM_CREATE, and in the MDIWndProc, or the Wnd Proc
WndProc.
Can you have more than one color in the same edit box? If not, can it be hardcoded :D? Thanks again :D !
No.
Not unless you're using Rich Edits or owner-drawing the edit boxes.
Simply put....what? Sorry for my ignorance!Quote:
Originally posted by Dante Shamest
Not unless you're using Rich Edits or owner-drawing the edit boxes.
Rich Edits are a more advanced version of normal edit controls.
Owner drawing refers to completely handling the drawing of your edit box.
You'll have to search MSDN for more documentation and information on them.
Ah - thanks :D !