本帖最后由 itljl 于 2010-8-18 12:29 编辑
下面的代码我们可以搜索到指定的文本的行数,但是,如何将这行文字设定为红色呢?谢谢。偿试过_GUICtrlListView_SetTextColor,但他是设置整个listview的颜色了。#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 591, 349, 192, 114)
$ListView1 = GUICtrlCreateListView("", 24, 24, 546, 302)
GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
_GUICtrlListView_AddColumn($ListView1, "任务", 150)
_GUICtrlListView_AddColumn($ListView1, "状态", 50)
GUICtrlCreateListViewItem("CCTV_654|正在运行", $ListView1)
GUICtrlCreateListViewItem("CCTV_65|正在运行", $ListView1)
GUICtrlCreateListViewItem("CCTV_6|正在运行", $ListView1)
GUICtrlCreateListViewItem("CCTV_001|CCTV_65", $ListView1)
GUICtrlCreateListViewItem("CCTV_003|CCTV_654", $ListView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$a = ControlListView($form1, "", $listview1, "FindItem", "CCTV_6")
MsgBox(0,0,$a)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|