在编辑框中为特定颜色的文本 [英] Color specific text in Edit Box

查看:72
本文介绍了在编辑框中为特定颜色的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,在基于对话框的应用程序中,我使用编辑框控件.我想使某些特定的单词以某种颜色上色,而不是将整个内容写到编辑框中.

Hello, in my dialog based application i use edit box control. I want to make it color some specific words in some color, not the whole thing written into the edit box. Thank you for help in advance!

推荐答案

使用常规编辑框很难做到.我看到以下选项:

-覆盖OnPaint处理程序,并通过自定义代码进行整个绘制.如果您想支持编辑控件的所有功能,那对我来说似乎真的很困难.

-使用富文本格式的编辑控件,而不是编辑控件.

您可能还想在该网站上搜索文本编辑器中使用的语法着色控件.在那里,您可能会得到更多的想法.
That''s hard to do with a regular edit box. I see the following options:

- Override the OnPaint handler and do the entire painting by custom code. That appears to me as really difficult if you want to support the full range of capabilities of an edit control.

- Use a rich text edit control instead of an edit control.

You might also want to search this website for syntax coloring controls used in text editors. There you might get some more ideas.


这篇关于在编辑框中为特定颜色的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆