Advertisement Jump to content
Sign in to follow this  

MFC RichEdit Controls: communicating back and forth between buttons.

This topic is 4589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heya, sorry to bug you guys with two separate MFC questions at once. This question has to do with communication between a RichEdit control and the text/paragraph formatting buttons. I have buttons for bold, italics, underline, strikethrough, and the left/right/center/justify alignments. I currently have it set up so that I can highlight text in the RichEdit control, press the text formatting buttons I want, and the text will update in the RichEdit control properly. However, most RTF editors go a step further, allowing the position of the cursor to determine which buttons are pressed. So, if you click to insert the typing cursor within text that is italicized, the italics button will appear depressed. Right now, my controls dont' do that. I was thinking that perhaps there is a message sent to my CFormView-derived class when the user clicks to insert a typing cursor somewhere, and I could look for that message, then obtain the CHARFORMAT2 for the text that the cursor was inserted into, then update the buttons and other controls accordingly. However, I don't know if any such message exists, or if this is the best way to handle this problem.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!