[已解决]Edit字体设置问题
本帖最后由 小凯 于 2011-10-4 13:53 编辑如上图,我想把bbbbbbbb那行的字体颜色改成红色,ccccccccc那行改为绿色!
如果这个空间不行,别的控件能达到这样也行! 求列子 这个还真是没有听说过,想来是不行的,我是用Table的,一行一行的搞。 richedit看看 本帖最后由 happytc 于 2011-10-3 18:41 编辑
如上图,我想把bbbbbbbb那行的字体颜色改成红色,ccccccccc那行改为绿色!
如果这个空间不行,别的控件能达 ...
小凯 发表于 2011-10-3 10:07 http://www.autoitx.com/images/common/back.gif
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Color.au3>
Main()
Func Main()
Local $hGui, $hRichEdit, $iMsg
$hGui = GUICreate("RichEdit", 320, 250)
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
GUISetState(@SW_SHOW, $hGui)
_GUICtrlRichEdit_SetText($hRichEdit, "aaaaaaaaaa" & @CRLF & "bbbbbbbbbb" & @CRLF & "cccccccccc")
_GUICtrlRichEdit_SetSel($hRichEdit, 0, 10)
_GUICtrlRichEdit_SetCharColor($hRichEdit, "102030")
_GUICtrlRichEdit_SetSel($hRichEdit, 11, 21)
_GUICtrlRichEdit_SetCharColor($hRichEdit, "255")
_GUICtrlRichEdit_SetSel($hRichEdit, 22, 32)
_GUICtrlRichEdit_SetCharColor($hRichEdit, "65280")
While True
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE
_GUICtrlRichEdit_Destroy($hRichEdit)
Exit
EndSwitch
WEnd
EndFunc
回复 4# happytc
3Q..达到我想要的要求了!谢谢! 又学了一招,谢谢。。。。
页:
[1]