找回密码
 加入
搜索
查看: 1765|回复: 2

如何使lit内文字自动换行?和某1行红色?

[复制链接]
发表于 2009-6-27 15:27:27 | 显示全部楼层 |阅读模式
本帖最后由 wuluck 于 2009-6-27 16:02 编辑

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>


$Form1                        = Guicreate("Form 1", 400, 400, -1, -1)
$list = GUICtrlCreateList("准备中", 176, 32, 121, 57)
GuiSetState(@SW_SHOW)






While 1
        $Msg = GUIGetMsg()
sleep(1000)

sleep(1000)
GUICtrlSetData($list, @HOUR & ":"& @MIN & ":" & @SEC & "测试

111111111114")
ControlFocus("Form 1", "", $list)
ControlSend ("Form 1","",$list,"{END}")
sleep(1000)
GUICtrlSetData($list, @HOUR & ":"& @MIN & ":" & @SEC & "测1111111111试

4"& @CR & @CR & "11111114")
ControlFocus("Form 1", "", $list)
ControlSend ("Form 1","",$list,"{END}")
sleep(1000)
GUICtrlSetData($list, @HOUR & ":"& @MIN & ":" & @SEC & "测11111111111试

4")
ControlFocus("Form 1", "", $list)
send("{END}")

sleep(1000)
GUICtrlSetData($list, @HOUR & ":"& @MIN & ":" & @SEC & "测试11111114")
ControlFocus("Form 1", "", $list)
send("{END}")
sleep(1000)

GUICtrlSetData($list, @HOUR & ":"& @MIN & ":" & @SEC & "测111111试4")
        Switch $Msg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
Wend


后面很多字被隐藏了.....


用GUICtrlSetData 重写 测试不实用...会导致不在最后行了

颜色用 GUICtrlSetColor 会导致整个框内文字变色的.只需要某一行变色.该用哪一个?好像说要GUICtrlCreateListView才能某行变色..
发表于 2009-6-28 04:22:17 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$List1 = GUICtrlCreateListView(" ", 80, 64, 460, 230,$LVS_NOCOLUMNHEADER)
GUICtrlSendMsg($List1, 0x101E, 0, 455)
GUISetState(@SW_SHOW)
$I = GUICtrlCreateListViewItem("这个是红色", $List1)
GUICtrlSetColor(-1, 0xFF0000)
$I = GUICtrlCreateListViewItem("这个是黑色", $List1)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd
这样变色?
 楼主| 发表于 2009-6-28 10:32:46 | 显示全部楼层
嗯.我改成了GUICtrlCreateListView了
请问如果框框太小出现水平滚动条怎么办?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-26 14:06 , Processed in 0.075004 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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