我想将 VB6 的 SaveSetting 命令与 ListView 一起使用
我的代码-
Private Sub Form_Load()
Dim i
For i = 1 To GetSetting("Listview", "items", "c")
ListView1.ListItems.Add i, , GetSetting("Listview", "items", "li" & i)
Next i
MsgBox ListView1.ListItems.count
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i
Dim count
If ListView1.ListItems.count = 0 Then
count = 1
Else
count = ListView1.ListItems.count
End If
For i = 1 To ListView1.ListItems.count
SaveSetting "Listview", "items", "li" & i, ListView1.ListItems(i).Text
Next
SaveSetting "Listview", "items", "c", ListView1.ListItems.count
End Sub
我需要保存所有列中所有行的值。请帮忙。
My Code-
Private Sub Form_Load()
Dim i
For i = 1 To GetSetting("Listview", "items", "c")
ListView1.ListItems.Add i, , GetSetting("Listview", "items", "li" & i)
Next i
MsgBox ListView1.ListItems.count
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i
Dim count
If ListView1.ListItems.count = 0 Then
count = 1
Else
count = ListView1.ListItems.count
End If
For i = 1 To ListView1.ListItems.count
SaveSetting "Listview", "items", "li" & i, ListView1.ListItems(i).Text
Next
SaveSetting "Listview", "items", "c", ListView1.ListItems.count
End Sub
I need to save the values of all rows in all cols. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 vsflexgrid 代替 listview
您可以将 flexgrid 保存在文件中 &再次重新加载,
的语法
只需查看保存
到加载
即可了解更多信息,请检查
http://www.fredshack .com/docs/vsflex.html
或 componentone 的网站
use vsflexgrid instead of listview
you can save flexgrid in a file & reload it again
just see the syntax
to save
to Load
for more info please check
http://www.fredshack.com/docs/vsflex.html
or componentone's website