The Richedit Ctrl used in chatting
This article was contributed by jyism21@chollian.net
I wanted an editbox that can be used in chatting. Every chat message was inserted after the last message, user name and message is distincted with another color and message has to have readonly attribute. After all, If the message is full of the edit box, the view is autoscrolled upward. To Use the CDalsuRichEdit... 1. Copy "DalsuRichEdit.h", "DalsuRichEdit.cpp" in your work directory 2. Add your project these two files 3. Add a member data ex:m_pDalRich or m_pDalRich 4. Create the CDalRichEdit's Window with suitable style The Description of member function 1. AddName(CString &strName, COLORREF &crColor); Specify the User Name and its color 2. AddText(CString &strTextIn, COLORREF &crColor); Specify text string and its color Don't forget! There are "\r\n" characters on the tail of this string. 3. AddMsg(CString &strMsg, COLORREF &crColor, BOOL bUnderLine, BOOL bBold); It's general system message. ex:A User joined this room... In the same manner, there are "\r\n" characters on the tail of this string. and I thank for Zafir Anjum, Tom Moor, Steve Dunn, Juraj Rojko 's codes...
ownload demo project - [size in KB] KB
Download source - [size in KB] KB
Date Posted: January 14, 1999