Hi, every one:
I have a problem with the underline style of richedit.let me descrip it in detail:
1,I input "abc" in richedit.
2,Then, i set only "c" with underline style."ab" remains the old style.
3,I select "abc" and set the bold or italic style to all of them.
4,"abc" has the style of bold or italic, and all the three characters have the underline style.This is confusing.The reasonable result is only the "c" has the underline style.
the code snippet i use is:
//set underline style
INT nStart, nEnd;
SendMessage( EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd, NULL );
If your selection includes the "c" character, then this is not completely illogical to have that flag set.
A solution would be to have a loop for each character, where the individual format of each character would be retrieved and changed to bold.