ichor
asked on
Edit vs. Rich Edit Controls
I'm wondering if the EDIT control can change text colors. I've tried before with SetTextColor() using MFC, and never could get it to work. Now I've recoded the entire thing WITHOUT MFC, and am wondering if I am just waisting my time...If it IS possible, could you let me know the correct syntax? (of the entire process, if possible.)
Also, besides some OLE stuff, are there any major advantages to using RichEdit instead of Edit?
Also, besides some OLE stuff, are there any major advantages to using RichEdit instead of Edit?
ASKER
Using the EDIT control, I can already change the font and size. But there's no way to change the color of the text using just Edit (instead of RichEdit)?
I was under the impression that using Windows COLORREF values that I could change RGB values of text, like I said before, using SetTextColor()
Although I never got it to work correct (it never worked at all, actually), I had once tried to use code like:
m_Color = GREEN; //GREEN defined in .h file.
HDC hdc;
SetTextColor(hdc, m_Color);
Obviously, this did not work. I'm still sure that I've seen color changing using SetTextColor() with just the Edit control though. Maybe I'm thinking of something else?
I was under the impression that using Windows COLORREF values that I could change RGB values of text, like I said before, using SetTextColor()
Although I never got it to work correct (it never worked at all, actually), I had once tried to use code like:
m_Color = GREEN; //GREEN defined in .h file.
HDC hdc;
SetTextColor(hdc, m_Color);
Obviously, this did not work. I'm still sure that I've seen color changing using SetTextColor() with just the Edit control though. Maybe I'm thinking of something else?
You can only have ONE font and size for the ENTIRE text in the edit control. In the rich edit control, each character can have a different style. I don't know of a way to change its color.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hmm...I'd like to give both of you points, but I don't think that's possible. Thanks for your help, though!
And no,you can't change the color of an edit control.