找回密码
 加入
搜索
查看: 1355|回复: 4

怎样用ListView显示这样的文本内容?

[复制链接]
发表于 2009-5-29 21:51:29 | 显示全部楼层 |阅读模式
本帖最后由 qq342252004 于 2009-9-2 20:02 编辑

问题如题,文本如下:
http://tieba.baidu.com/
http://zhidao.baidu.com/
http://mp3.baidu.com/
http://image.baidu.com/
http://news.baidu.com/
http://video.baidu.com/

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-5-29 22:02:27 | 显示全部楼层
什么意思? listview的例子应该可以让你明白如何使用listview吧
还是你有什么问题没有表达清楚?
发表于 2009-5-30 17:43:17 | 显示全部楼层
估计是问怎么从文本那里自动读取每行字符,然后自动导入创建的Gui里面显示出来吧?
思路:
1.GUICtrlCreateListView建立ListView
2.FileReadLine 读取指定文本
3.GUICtrlCreateListViewItem写入ListView
发表于 2009-6-21 18:25:45 | 显示全部楼层
发表于 2009-6-21 18:54:33 | 显示全部楼层
[au3]#include <GUIConstants.au3>
$file = FileOpen("txt.txt", 0)
If $file = -1 Then
        MsgBox(0, "错误", "不能打开文件.")
        Exit
EndIf
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 430, 336, 193, 125)
$List1 = GUICtrlCreateListView("编号|内容", 32, 24, 329, 227)
$i = 1
While 1
        $temp = FileReadLine($file)
        If @error Then ExitLoop
        If Not $temp = "" Then
                GUICtrlCreateListViewItem($i & "|" & $temp, $List1)
                $i += 1
        EndIf
       
WEnd
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd[/au3]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-11 17:35 , Processed in 0.078521 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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