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

Loops

This Visual Basic code defines two button click event handlers within a Form1 class. The first handler uses a Do Until loop to display a message box counting from 1 to 5. The second handler uses a Do While loop to also display a counting message box from 1 to 5. Both loops increment a Num variable to track the loop iteration number.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Loops

This Visual Basic code defines two button click event handlers within a Form1 class. The first handler uses a Do Until loop to display a message box counting from 1 to 5. The second handler uses a Do While loop to also display a counting message box from 1 to 5. Both loops increment a Num variable to track the loop iteration number.

Uploaded by

api-310300017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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 Num As Integer = 1
Do Until Num = 5
Num += 1
MessageBox.Show("The value of num is : " & Num)
Loop
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
Dim Num As Integer = 1
Do While Num <= 5
MessageBox.Show("The value of num is : " & Num)
Num += 1
Loop
End Sub
End Class

You might also like