是否可以突出显示Win32编辑控件中的文本? [英] Is it possible to highlight text in a Win32 edit control?
本文介绍了是否可以突出显示Win32编辑控件中的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个加载文本文件的 Win32 程序。是否可以突出显示在编辑框中的特定词?
I am working on a Win32 program in which I load text files. Would it be possible to highlight a particular word that is being displayed in the edit box?
通过突出显示,我的意思是,像语法中改变文本的颜色
By highlight, I mean, something like changing the color of the text as in syntax highlighting.
推荐答案
标准Edit控件不支持。请改用RichEdit控件。它支持通过 EM_SETCHARFORMAT
消息将字体/颜色设置应用于一系列字符。
A standard Edit control does not support that. Use a RichEdit control instead. It supports applying font/color settings to a range of characters via the EM_SETCHARFORMAT
message.
这篇关于是否可以突出显示Win32编辑控件中的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文