CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    98

    How to set richedit ctrl full line's background color?

    I've googled to set the background color of the text using following code
    Code:
    CHARFORMAT2 cf;
    cf.cbSize = sizeof(cf);
    cf.dwMask = CFM_BACKCOLOR;
    cf.dwEffects = CFE_PROTECTED;
    cf.crBackColor = m_crBkTwo;
    m_edText.SendMessage(EM_SETCHARFORMAT, (WPARAM)SCF_SELECTION|SCF_WORD,
    	(LPARAM)&cf);
    But the effect is just setting background color of inserting text, not full line,
    Is there some way to set full line using the color?
    I thought the code would do the right thing as I expected, but nothing happens, it's really awful!

  2. #2
    Join Date
    May 2010
    Posts
    33

    Re: How to set richedit ctrl full line's background color?

    You don't want to set the entire background right?

  3. #3
    Join Date
    Jan 2008
    Posts
    98

    Re: How to set richedit ctrl full line's background color?

    Quote Originally Posted by pm44xl22 View Post
    You don't want to set the entire background right?
    Sorry for my late reply, timezone reason!

    No, I don't want to set the entire background. I just want to set color in entire line only!
    I thought the code would do the right thing as I expected, but nothing happens, it's really awful!

  4. #4
    Join Date
    Jan 2008
    Posts
    98

    Re: How to set richedit ctrl full line's background color?

    So maybe richedit control can't do that?
    I thought the code would do the right thing as I expected, but nothing happens, it's really awful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured