GUI Text Color Problem
Hi everyone. I've ran into a little, well, a huge problem. I'm working on a syntax coloring text editor... My only problem is actually doing the coloring. In a basic edit control, I can't have more than one font color in the control at once. So, for example, if I set the text color to blue because I want one word to be blue, all the text becomes blue. This is kindof the most important part of the program.... yet I can't find any articles from google, any tutorials, or any guidance on the best direction of approaching this problem.. Does anyone know of a good article that would help me, or very good tutorial, or does anyone just plain know how to do this?
Do I need to implement some other control? Am I going about this the wrong way? Any help would be greatly appreciated. Thanks in advance.
I'm guessing you're writing for Windows because of mentioning "a basic edit control".
Check MSDN for a Rich Edit Control or whatever it's actually named.
Oops, sorry I forgot to mention that. Yes, I am using a Windows.
You would have to use a Rich Edit Control, or make a custom callback for your control and just paint your own text using TextOut() when it gets a WM_PAINT message. (Also, use SetTextColor() to change text color.)