Implementing Text highlighting in Rich Edit Control
-
Hi all, I have an application written in Visual C++6.0 which uses a Rich Edit Control to display user chat. I want to implement text highlighting as in MS Word for this rich edit control so that I can highlight messages from particular players. I am using CHARFORMAT structure for formatting text. Can someone help me implementing this? I tried using CHARFORMAT2 which has text BackColor property but it didnt help. Thanking in anticipation Sachin Bhave
-
Hi all, I have an application written in Visual C++6.0 which uses a Rich Edit Control to display user chat. I want to implement text highlighting as in MS Word for this rich edit control so that I can highlight messages from particular players. I am using CHARFORMAT structure for formatting text. Can someone help me implementing this? I tried using CHARFORMAT2 which has text BackColor property but it didnt help. Thanking in anticipation Sachin Bhave
CHARFORMAT2 cf; memset(&cf, 0, sizeof(CHARFORMAT2)); cf.cbSize = sizeof(CHARFORMAT2); cf.dwMask = CFM_BOLD; cf.dwEffects = CFE_BOLD; COLORREF clr =RGB(255, 10, 15) ; cf.dwMask =CFM_COLOR; //cf.dwEffects = CFE_AUTOCOLOR; // Bold cf.crTextColor = clr;