MFC RichEdit Controls: communicating back and forth between buttons.

Started by
-1 comments, last by uncle_rico 17 years, 9 months ago
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.

This topic is closed to new replies.

Advertisement