1.VBçListviewä¿å读å
VBçListviewä¿å读å
å®æ´ä»£ç 注ï¼Listviewå®ä¹äº4个å,源码spring源码下载部署èªå·±éè¦å åæ¹ä¸å°±å¥½Option Explicit
'读åINIæ件
Private Declare Function GetPrivateProfileString Lib "kernel" 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 "kernel" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As LongPrivate Sub Form_Load()
Randomize
End SubPrivate Sub éæºå¼_Click()
Dim i As Integer, j As Integer, lv As ListItem
ListView1.ListItems.Clear
For i = 0 To
Set lv = ListView1.ListItems.Add(, , i + 1)
For j = 0 To 2
lv.ListSubItems.Add , , CInt(Rnd * )
Next j
Next i
End SubPrivate Sub ä¿å_Click()
Dim si As Integer, sj As Integer, tmpstr As String
If ListView1.ListItems.Count = 0 Then MsgBox "没æå¯ä¿åçå 容", vbInformation, "æ示": Exit Sub
tmpstr = ListView1.ListItems.Count
WritePrivateProfileString "ç»è®¡é¡¹", "æ»è¡æ°", tmpstr, App.Path & "\ABC.ini"
tmpstr = ListView1.ListItems(1).ListSubItems.Count
WritePrivateProfileString "ç»è®¡é¡¹", "æ»åæ°", 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 SubPrivate Sub 读å_Click()
Dim sr As Integer, sc As Integer, li As Integer, lj As Integer, tmptxt As String, lvs As ListItem
tmptxt = Space$()
GetPrivateProfileString "ç»è®¡é¡¹", "æ»è¡æ°", "0", tmptxt, , App.Path & "\ABC.ini"
sr = CInt(tmptxt) 'æ»è¡æ°
tmptxt = Space$()
GetPrivateProfileString "ç»è®¡é¡¹", "æ»è¡æ°", "0", tmptxt, , App.Path & "\ABC.ini"
sc = CInt(tmptxt)
If sr = 0 Then
MsgBox "æ»è¡æ°ä¸ºé¶å¦"
Exit Sub
Else
ListView1.ListItems.Clear
End If
For li = 1 To sr
For lj = 1 To sc 'è¿éä½ çå表
tmptxt = Space$()
GetPrivateProfileString "第" & li & "è¡", "第" & lj & "å", "", tmptxt, , 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
2024-12-29 16:231253人浏览
2024-12-29 16:072869人浏览
2024-12-29 14:592003人浏览
2024-12-29 14:51560人浏览
2024-12-29 14:41192人浏览
2024-12-29 14:02436人浏览
记者从铁路12306科创中心获悉,12月15日,铁路12306手机客户端务工人员预约购票服务上线,符合条件的旅客朋友可通过专区预约购买2025年春运期间往返车票,重点群体旅客春运出行将更加便利。铁路1
美媒:以色列开辟针对联合国新战线2024-10-14 09:26:00评论:字体大小 T T T以色列卷入了多条战线的冲突——打击加沙地带的哈马斯、打击黎巴嫩的真主党武装组织、打击约旦河西岸新一茬的巴
海珠区一处城中村。11月28日该区启动大规模疏散。 人民视觉/图)“原来一百多人,现在只剩下三十几个人了。”2022年11月28日,广州市海珠区启动大规模疏解,此轮疫情中因为收留街坊而备受关注的一家台