如何在 Delphi 的丰富编辑中更改特定字符的颜色?
我必须做一个项目,在该项目中,我必须将丰富编辑中的一行中特定单个字符的颜色更改为随机颜色,或者更改丰富编辑中整行的颜色到随机颜色。 是否可以不断随机更改丰富编辑中出现的字符串或字符的颜色以及如何更改? 颜色也必须保持闪烁,以提供持续闪烁的效果,就像丰富的编辑中灯光闪烁一样。任何帮助将不胜感激。
Possible Duplicate:
How can I change the color of certain characters in a TRichEdit?
I have to do a project in which I have to either change the color of specific individual characters in a line in a rich edit to random colors or change the color of a whole line in a rich edit to random colors .
Is it possible to keep randomly changing the color of a string or character which appears in the rich edit and how ?
The colors have to keep flickering too to give a constant blinking effect like lights flashing on and off in the rich edit . Any help would be appreciated .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以在运行时随时通过选择该区域(使用 SelStart 和 SelLength)并更改属性(使用 SelAttributes)来更改 RichEdit 中文本选定部分的所有属性(字体、大小、颜色、样式)。
Yes, you can change all the attributes of selected portions of text in a RichEdit (font, size, color, style) whenever you want at runtime by selecting that area (with SelStart and SelLength) and changing the attributes (with SelAttributes).