Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer, sum As Integer
        sum = 0
        While i <= 100
            sum = sum + i
            i += 1
        End While
        MsgBox("1+2+3+…+100=" & Str(sum), , "累加")
    End Sub
End Class
