vb listview 添加“列”数据的问题
PrivateSubForm_Load()Dima()AsIntegerDimb()AsIntegerFori=0To5Step1ReDimPreservea(i)a(i...
Private Sub Form_Load()
Dim a() As Integer
Dim b() As Integer
For i = 0 To 5 Step 1
ReDim Preserve a(i)
a(i) = i
Next
For i = LBound(a) To UBound(a)
’要向listview1第一列填充a(i),代码?????
Next
For i = 0 To 10 Step 1
ReDim Preserve b(i)
b(i) = i
Next
For i = LBound(b) To UBound(b
’要向listview1第一列追加填充b(i)数组,代码?????
Next
End Sub
请问大神们如何写呢??? 展开
Dim a() As Integer
Dim b() As Integer
For i = 0 To 5 Step 1
ReDim Preserve a(i)
a(i) = i
Next
For i = LBound(a) To UBound(a)
’要向listview1第一列填充a(i),代码?????
Next
For i = 0 To 10 Step 1
ReDim Preserve b(i)
b(i) = i
Next
For i = LBound(b) To UBound(b
’要向listview1第一列追加填充b(i)数组,代码?????
Next
End Sub
请问大神们如何写呢??? 展开
2个回答
展开全部
Private Sub Form_Load()
Dim a() As Integer
Dim b() As Integer
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "A", 1000
ListView1.ColumnHeaders.Add , , "B", 1000
For i = 0 To 5 Step 1
ReDim Preserve a(i)
a(i) = i
Next
For i = LBound(a) To UBound(a)
'要向listview1第一列填充a(i),代码?????
ListView1.ListItems.Add , , a(i)
Next
For i = 0 To 10 Step 1
ReDim Preserve b(i)
b(i) = i
Next
For i = LBound(b) To UBound(b)
'要向listview1第一列追加填充b(i)数组,代码?????
ListView1.ListItems.Add , , b(i)
Next
End Sub
Dim a() As Integer
Dim b() As Integer
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "A", 1000
ListView1.ColumnHeaders.Add , , "B", 1000
For i = 0 To 5 Step 1
ReDim Preserve a(i)
a(i) = i
Next
For i = LBound(a) To UBound(a)
'要向listview1第一列填充a(i),代码?????
ListView1.ListItems.Add , , a(i)
Next
For i = 0 To 10 Step 1
ReDim Preserve b(i)
b(i) = i
Next
For i = LBound(b) To UBound(b)
'要向listview1第一列追加填充b(i)数组,代码?????
ListView1.ListItems.Add , , b(i)
Next
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询