我正在尝试更改在 Visual Basic 中的 Do While 循环的每次迭代期间标签显示的文本。一个标签(显示一个整数)工作正常,但另一个标签保持空白,直到循环完成并显示最终结果。可能是什么问题呢?
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnOblicz.Click
Dim W As Single
Dim L As Integer
Dim J As Integer
Dim Y As Double
W = Val(txtW.Text)
L = InputBox("Input L")
J = 0
If W > 0 And W < 100 Then
Do
Y = (2 * Math.Sqrt(W)) / (L - J)
J = J + 1
lblJ.Text = Str(J)
lblY.Text = Str(Y)
MsgBox("Next...")
Loop Until Y < 0
Else
MsgBox("No calculations, because the number is less than zero or greater than a hundred.")
End If
End Sub