| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 807 人关注过本帖, 1 人收藏
标题:[求助]通过CommonDialog在listview中显示程序路径后,如何显示程序图标?
只看楼主 加入收藏
lowgrade
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-7-11
收藏(1)
 问题点数:0 回复次数:1 
[求助]通过CommonDialog在listview中显示程序路径后,如何显示程序图标?
就好像防火墙的程序规则列表一样的
搜索更多相关主题的帖子: CommonDialog listview 路径 图标 
2007-07-13 10:31
feist1
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-7-13
收藏
得分:0 

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

我写的小程序的一段

2007-07-13 20:06
快速回复:[求助]通过CommonDialog在listview中显示程序路径后,如何显示程序图标 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027703 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved