-1
Private Sub btnRunDemo_Click(ByVal sender As System.Object, By Val e As System.EventArgs) Handles btnRunDemo.Click

  Dim count As Integer = 0

  Do While count > 10
      1stOutput.Items.Add("Hello")
      count += 1

  Loop
End Sub

任何帮助,将不胜感激。谢谢!

4

1 回答 1

2

如果设置为,则永远While>10不会进入那里。你需要使用.count0Until

While这里的意思是'只要计数大于 10 就执行循环'。但是您将 count 设置为 0,因此它不大于 10,因此它不会进入循环。

Private Sub btnRunDemo_Click(ByVal sender As System.Object, By Val e As System.EventArgs) Handles btnRunDemo.Click

  Dim count As Integer = 0

  Do Until count > 10
      1stOutput.Items.Add("Hello")
      count += 1

  Loop
End Sub
于 2013-09-18T17:28:49.790 回答