简体   繁体   English

NSIS,在特定单词上设置文本颜色(不是全部控件)

[英]NSIS, set text color on specific words (not the all control)

I'm trying to have only specific words in a text area to be a certain color. 我试图在文本区域中仅将特定单词设置为某种颜色。

nsDialogs::Create 1018
Pop $0

; Text area
nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_CLIPCHILDREN}|${WS_TABSTOP}|${ES_WANTRETURN}|${ES_MULTILINE} ${__NSD_Text_EXSTYLE} 5 220 660 115 ''
Pop $1
SendMessage $1 ${EM_SETREADONLY} 1 0
SetCtlColors $1 0x000000 0xFFFFFF ; Black on white

${NSD_SetText} $1 "I want only the 'click me' to be blue ->CLICK ME<-"

nsDialogs::Show

How should I do to have only the 'CLICK ME' in blue letters ? 我该怎么办才能只用蓝色字母显示“点击我”?

Thanks in advance for any help or hints. 在此先感谢您的帮助或提示。

The thing here is that it is still one single handle ( 这里的事情是它仍然是一个单一的句柄(

HDC HDC

) for all text area. )的所有文本区域。

Take a look at this sample: http://msdn.microsoft.com/en-us/library/windows/desktop/dd162491(v=vs.85).aspx ; 看一下此示例: http : //msdn.microsoft.com/zh-cn/library/windows/desktop/dd162491(v=vs.85).aspx the

TextOut 文字输出

method... 方法...

So, I really doubt that you have any better hasle-free ( including additional plugins ) option than simply use another text control ( split one text control into three text controls ). 因此,我真的怀疑您是否有比仅使用另一个文本控件(将一个文本控件分成三个文本控件)更好的无哈希(包括其他插件)选项。

Maybe Anders got some trick under the hood... :) 也许安德斯在引擎盖下有一些诡计... :)

一个选项是一个标签位于另一个标签的顶部,另一个选项是使用带有RTF内容的RichEdit控件...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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