简体   繁体   中英

Winapi edit control chenge selected text font color

I have text in edit control and I want to change color to some piece of text. In Embarcadero C++ builder, I'm selecting text like this:

edit1->SelStart = 10;
edit1->SelLength = 12;

and then change color:

edit1->SelAttributes->Color = clRed;

It's posible in Winapi standard Edit control or I must use Rich edit?

The short answer. No, you have to use a Rich Edit Control. Here a link to all messages a editcontrol can process: link

A standard Edit control does not support per-character text formatting. You must use a RichEdit control for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM