Just wondering - is it possible to use colored text in an edit box? If not, can it be hardcoded? Thanks !
Just wondering - is it possible to use colored text in an edit box? If not, can it be hardcoded? Thanks !
Do not make direct eye contact with me.
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 }
Last edited by Dante Shamest; 05-28-2003 at 08:12 AM.
Does this go in WM_COMMAND, WM_CREATE, and in the MDIWndProc, or the Wnd Proc
Do not make direct eye contact with me.
Can you have more than one color in the same edit box? If not, can it be hardcoded ? Thanks again !
Do not make direct eye contact with me.
No.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Not unless you're using Rich Edits or owner-drawing the edit boxes.
Simply put....what? Sorry for my ignorance!Originally posted by Dante Shamest
Not unless you're using Rich Edits or owner-drawing the edit boxes.
Do not make direct eye contact with me.
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.
Last edited by Dante Shamest; 05-29-2003 at 09:41 PM.
Ah - thanks !
Do not make direct eye contact with me.