找回密码
 加入
搜索
查看: 1946|回复: 5

[AU3基础] edit控件如何设置高亮字符

  [复制链接]
发表于 2016-1-24 15:58:55 | 显示全部楼层 |阅读模式
如题:EDIT中内容如何设置高亮显示。
如edit中内容:Run("notepad.exe", "", @SW_SHOWMAXIMIZED)
如何设置高亮显示:Run
发表于 2016-1-24 17:02:01 | 显示全部楼层
这个要先创建RichEdit富文本编辑控件,EDIT控件肯定不行吧
#include <GuiRichEdit.au3>
_GUICtrlRichEdit_Create($hWnd, $sText, $iLeft, $iTop [, $iWidth = 150 [, $iHeight = 150 [, $iStyle = -1 [, $iExStyle = -1]]]])
 楼主| 发表于 2016-1-24 17:36:53 | 显示全部楼层
回复 2# afan


    请教A版,这个富文本编辑控件怎么设置颜色。帮助中并没有介绍。
发表于 2016-1-24 18:09:58 | 显示全部楼层
回复 3# haijie1223
#include <Color.au3>
#include <GuiRichEdit.au3>

Local $hGui = GUICreate('')
Local $g_hRichEdit = _GUICtrlRichEdit_Create($hGui, '', 5, 5, 390, 220)
GUISetState()
_GUICtrlRichEdit_SetText($g_hRichEdit, 'Run("notepad.exe", "", @SW_SHOWMAXIMIZED)')
_GUICtrlRichEdit_SetSel($g_hRichEdit, 0, 3, True)
Local $aColor[3] = [0xFF, 0x0, 0x0]
Local $vCOLORREF = _ColorSetCOLORREF($aColor)
_GUICtrlRichEdit_SetCharColor($g_hRichEdit, $vCOLORREF)
Sleep(2000)
发表于 2016-1-24 20:38:10 | 显示全部楼层
帮你顶
发表于 2016-1-25 19:48:59 | 显示全部楼层
不知要用在什么地方?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-29 00:23 , Processed in 0.086233 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表