But upstairs, so defined, how can you control word wrap?
I want to display the color of different words in a cell of MFCgridCtrl. For example, the word I searched should be displayed in red.
I don't want to do manual line wrapping, DrawText can automatically wrap based on the size of Rect.
Use SetTextColor to determine the color
Draw with DrawTextA
A color is drawn once, the coordinates of the character are specified in the parameter lpRect,
Draw as much as you want,
Isn't it OK?
The total character width of each line displayed should not be greater than the width of the parameter lpRect coordinate interval, otherwise it will be displayed in a new line. Chinese and English are only different in pixel height and width for DrawTextA, ok
For example, if I want to make the searched phrase appear red, but it happens that half of the phrase is on one line and the other half is on the next line, use
Isn't drawtext troublesome?