Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRunDemo.Click Dim intCount As Integer Dim strLimit As String = InputBox("How many squares?", "Input needed") Dim intLimit As Integer = CInt(strLimit) Dim intValue, intSquare As Integer Dim intSumVals As Integer = 0, intSumSqrs As Integer = 0 For intCount = 1 To intLimit intValue = 2 * intCount - 1 intSquare = intValue * intValue lstOutput.Items.Add("The square of " & intValue & " is " & intSquare) intSumVals += intValue intSumSqrs += intSquare Next intCount lstOutput.Items.Add("Sum of values = " & intSumVals & " sum of squares is " & intSumSqrs) End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click lstOutput.Items.Clear() MsgBox("Cleared it") sender.text = "yo" End Sub End Class