编辑:我有一个 ItemList : Dim ItemList As New List(Of String) 我想将 itemlist 中的每个元素附加到一个新列表中,每次 10 次,然后重新开始。当列表中仍有元素(每个 10 次)时,如何为每个元素创建一个循环?
我试过这个,但它不工作。这对我来说太复杂了,因为我是新手
Private crt As Integer = 0
Private limit As Integer = 0
Private Function getline() As String
Dim line As String = ""
SyncLock addlines
Do While limit < 10
line = ItemList(crt)
limit += 1
Loop
limit = 0
crt += 1
End SyncLock
addlines.AppendText(Environment.NewLine & line & " limit:" & limit & " crt:" & crt)
'Return line
End Function
谢谢
我也试过这个:
For Each I As Item In Items
If I = x Then Continue For
' Do something
Next
但我不知道在哪里添加 10 次限制以及当前项目编号(crt)