欧美成人精品手机在线观看_69视频国产_动漫精品第一页_日韩中文字幕网 - 日本欧美一区二区

LOGO OA教程 ERP教程 模切知識(shí)交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

VB的Listview保存讀取

admin
2013年12月14日 22:6 本文熱度 5678

完整代碼


注:Listview定義了4個(gè)列,自己需要幾列改下就好


Option Explicit
'讀寫INI文件
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long


Private Sub Form_Load()
Randomize
End Sub


Private Sub 隨機(jī)值_Click()
Dim i As Integer, j As Integer, lv As ListItem
ListView1.ListItems.Clear
For i = 0 To 14
Set lv = ListView1.ListItems.Add(, , i + 1)
For j = 0 To 2
lv.ListSubItems.Add , , CInt(Rnd * 30)
Next j
Next i
End Sub


Private Sub 保存_Click()
Dim si As Integer, sj As Integer, tmpstr As String
If ListView1.ListItems.Count = 0 Then MsgBox "沒有可保存的內(nèi)容", vbInformation, "提示": Exit Sub
tmpstr = ListView1.ListItems.Count
WritePrivateProfileString "統(tǒng)計(jì)項(xiàng)", "總行數(shù)", tmpstr, App.Path & "\ABC.ini"
tmpstr = ListView1.ListItems(1).ListSubItems.Count
WritePrivateProfileString "統(tǒng)計(jì)項(xiàng)", "總列數(shù)", tmpstr, App.Path & "\ABC.ini"
With ListView1.ListItems
For si = 1 To .Count
WritePrivateProfileString "第" & si & "行", "第1列", .Item(si).Text, App.Path & "\ABC.ini"
For sj = 1 To .Item(si).ListSubItems.Count
WritePrivateProfileString "第" & si & "行", "第" & sj + 1 & "列", .Item(si).SubItems(sj), App.Path & "\ABC.ini"
Next sj
Next si
End With
MsgBox "保存成功!", vbInformation, "提示"
End Sub


Private Sub 讀取_Click()
Dim sr As Integer, sc As Integer, li As Integer, lj As Integer, tmptxt As String, lvs As ListItem
tmptxt = Space$(100)
GetPrivateProfileString "統(tǒng)計(jì)項(xiàng)", "總行數(shù)", "0", tmptxt, 100, App.Path & "\ABC.ini"
sr = CInt(tmptxt) '總行數(shù)
tmptxt = Space$(100)
GetPrivateProfileString "統(tǒng)計(jì)項(xiàng)", "總行數(shù)", "0", tmptxt, 100, App.Path & "\ABC.ini"
sc = CInt(tmptxt)
If sr = 0 Then
MsgBox "總行數(shù)為零哦"
Exit Sub
Else
ListView1.ListItems.Clear
End If
For li = 1 To sr
For lj = 1 To sc '這里你的列表
tmptxt = Space$(100)
GetPrivateProfileString "第" & li & "行", "第" & lj & "列", "", tmptxt, 100, App.Path & "\ABC.ini"
If lj = 1 Then
Set lvs = ListView1.ListItems.Add(, , tmptxt)
Else
lvs.ListSubItems.Add , , tmptxt
End If
Next lj
Next li
End Sub


該文章在 2013/12/14 22:06:18 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國(guó)內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉(cāng)儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購(gòu)管理,倉(cāng)儲(chǔ)管理,倉(cāng)庫(kù)管理,保質(zhì)期管理,貨位管理,庫(kù)位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved