visual c++ - Problems encountered in changing a CRichEditCtrl selection color -


I wrote the following code after creating CRichEditCtrl

// 06112010: The following code was added: CRichEditCtrl To highlight texts in black instead of the default blue color - 1311

{

  m_EditControl.SetSel (0,100); CHARFORMAT2 CF1; Cf1.cbSize = sizeof (CHARFORMAT2); M_EditControl.GetSelectionCharFormat (cf1); Cf1.dwMask = CFM_BACKCOLOR; Cf1.dwEffects & amp; = ~ CFE_AUTOBACKCOLOR; Cf1.crBackColor = RGB (0,0,0); M_EditControl.SetSelectionCharFormat (cf1); M_EditControl.Invalidate ();  

}

After this I am adding text, but selection comes in blue rather than black. Can anyone tell me what I'm doing wrong? Thank you, DIV

You can not do this by using SetSelectionCharFormat, which only reproduces the selected text Will do The person you are asking is the owner who attracts rich editing control, which is going to work more than creating your own custom window from the CWND and implementing your own WM_PAINT handler.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -