我怎样才能在 vb 的列表框中创建一个数据循环?

how can i make a loop of data having in listbox in vb?

我有一个值为整数的列表框。我想制作 2 个循环

 Do While objReader.Peek() <> -1
 TextLine = objReader.ReadLine()
 words = TextLine.Split(New Char() {","c})
 ListBox1.Items.Add(words(3) & "," & words(4))
    Loop
 For i As Integer = 0 To ListBox1.Items.Count - 1
   Dim tempstr = ListBox1.Items.Item(i)
   tempstr = ListBox1.Items(i)
   Value = tempstr.Split(","c)
   Data= Value(0)
  Next

我想做2个数据表

  1. 删除 value1 的第一项
  2. 删除 value1 的最后一项

你可以像这样循环。 首先你得到了从头到尾的值 -1 在你从第二个(没有第一个)到最后一个

 For j As Integer = 0 To ListBox1.Items.Count - 2
  Dim first = ListBox1.Items(j).ToString
  Dim sec = ListBox1.Items(j+1).ToString
 Next

我认为这可以解决您的问题