0% found this document useful (0 votes)
40 views

Exercise 9

This Visual Basic code handles a button click event that takes numeric values from two text boxes, performs a calculation in a while loop by incrementing and summing the values, and displays the running total and final result in a label. It initializes variables from the text boxes for the start and end values, initializes a tracker variable, sets the label text to the start value, performs a while loop that increments the start value, concatenates it to the label, and sums it to the tracker, and finally displays the full calculation process and total in the label.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Exercise 9

This Visual Basic code handles a button click event that takes numeric values from two text boxes, performs a calculation in a while loop by incrementing and summing the values, and displays the running total and final result in a label. It initializes variables from the text boxes for the start and end values, initializes a tracker variable, sets the label text to the start value, performs a while loop that increments the start value, concatenates it to the label, and sums it to the tracker, and finally displays the full calculation process and total in the label.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim start As Integer = TextBox1.Text
Dim endn As Integer = TextBox2.Text
Dim tracker As Integer = 1
Label3.Text = start
While start <= endn
start = start + 1
Label3.Text = Label3.Text + "+" + start.ToString
tracker = tracker + start
End While
Label3.Text = Label3.Text + " = " + tracker.ToString
End Sub
End Class

You might also like