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
任何帮助将不胜感激。谢谢!
答案 0 :(得分:2)
如果While>10
设置为count
,则0
不会进入该位置。您需要使用Until
。
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