Hello everyone,

I thought i'd make myself a simple little chat program as a way of learning a bit about Winsock (thanks for the tutorials Thomas, only bad thing about them is the rate they get updated!)

The Winsock part has been easy, i'm having problems with things you would think would be simple like changing the colour of text in an edit box!

I've searched the messageboard for examples, i know how to change the background colour & text colour for the whole edit box window, but it seems impossible to have lines of different coloured text within the same edit box...so one person can type in black....one in blue...etc...

Anybody know how i can do this? ....I've got a horrible feeling its only possible with RichEdit, or just writing a custom edit box or sumthing....

Any help would be great.

Kind Regards,
Lennon.
Posted on 2003-03-17 14:19:00 by Lennon
RichEdit seems to be a sulotion..
Editcontrol can have only background color afaik
Posted on 2003-03-18 00:07:38 by wizzra
Thanks for the reply Wizzra,

so it looks like standard edit box's cant handle different colour text. What about subclassing/superclassing the edit box, would it be possible then?

Lennon.
Posted on 2003-03-18 08:13:10 by Lennon
Unless you want to create your own custom control I suppose..
Posted on 2003-03-18 08:26:44 by roticv
Hmmm i wanted to find out exactly what was possible with the edit control before i started thinking about trying other things.

Now i think about it tho, if i start writing custom edit control's and the like, its going to kinda distract from the fact that i started this to learn about Winsock :grin: but once i start something like this i can never seem to stop myself from trying to make it better....and better.....

Somebody shoot me!
Posted on 2003-03-18 08:36:01 by Lennon
Lennon, have a look at WM_CTLCOLOR* messages. You handle these in the parent window (ie, don't send them to the edit control).
Posted on 2003-03-18 12:03:08 by f0dder
thanks F0dder.

I've tried doing different things with the WM_CTLCOLOR* messages, namely WM_CTLCOLORDLG, but it only seems possible to change the text colour as a whole, i cant get different coloured text within the same edit box.

Cheers Lennon.
Posted on 2003-03-18 14:33:25 by Lennon
ach, sorry for not reading your post thoroughly enough. yeah, you'll probably have to go richedit or custom control.
Posted on 2003-03-18 16:19:02 by f0dder