找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 501|回复: 4

[求助]通过CommonDialog在listview中显示程序路径后,如何显示程序图标?

[复制链接]
发表于 2009-11-21 03:03:37 | 显示全部楼层 |阅读模式 IP:江苏扬州
就好像防火墙的程序规则列表一样的
发表于 2009-11-21 03:03:38 | 显示全部楼层 IP:江苏扬州
Sub loadlove()
Dim str As String
Dim ii As Integer
Dim imgX As ListImage

ListView1.ListItems.Clear
Open "F:\软件\vb\2007\love.txt" For Input As #1
'Open App.path & "\love.txt" For Output As #1
If LOF(1) > 0 Then

While Not EOF(1)
X = DoEvents
Line Input #1, str

Dim youxilujing As String
youxilujing = cutstr(str, "[游戏路径]", ";")
youxilujing = Mid(youxilujing, InStrRev(youxilujing, "\") + 1, -InStrRev(youxilujing, "\") + InStrRev(youxilujing, ".") - 1)




If Dir("f:\模拟游戏\mame\icons\" & youxilujing & ".ico") = "" Then
youxilujing = "005"
End If
Set imgX = ImageList1.ListImages. _
Add(, , LoadPicture("f:\模拟游戏\mame\icons\" & youxilujing & ".ico"))
'添加一个图象到 ImageList2--小图标 ImageList。
Set imgX = ImageList2.ListImages. _
Add(, , LoadPicture("f:\模拟游戏\mame\icons\" & youxilujing & ".ico"))


ListView1.Icons = ImageList1
ListView1.SmallIcons = ImageList2


Set li = ListView1.ListItems.Add(Text:=cutstr(str, "[游戏名称]", ";"))

li.Icon = ImageList1.ListImages.Count '设置 ImageList1 中的一个图标。
li.SmallIcon = ImageList2.ListImages.Count '设置 ImageList2 中的一个图标。

Set si = li.ListSubItems.Add(Text:=Mid(cutstr(str, "[游戏路径]", ";"), InStrRev(cutstr(str, "[游戏路径]", ";"), "\") + 1, -InStrRev(cutstr(str, "[游戏路径]", ";"), "\") + InStrRev(cutstr(str, "[游戏路径]", ";"), ".") - 1) & ".zip")


Set si = li.ListSubItems.Add(Text:=cutstr(str, "[游戏路径]", ";"))

Set si = li.ListSubItems.Add(Text:=cutstr(str, "[模拟器]", ";"))


lindex = lindex + 1
Wend
End If

Close #1
End Sub

我写的小程序的一段
回复

使用道具 举报

发表于 2009-12-20 22:05:05 | 显示全部楼层 IP:印度尼西亚
留个脚印,嘻嘻,脚有点臭```````
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:16 , Processed in 0.252756 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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