ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Visual BASIC .NET 2012
PART 19-INPUTBOX USING FOR..LOOP
Dr. GIRIJA NARASIMHAN 1
This slides are available http://slideshare.net /nbgirija
Dr. GIRIJA NARASIMHAN 2
This tutorial only for beginners , those
who don’t have any knowledge about
any programming language skill and
application design.
Dr.GIRIJA NARASIMHAN 3
Public Class Form5
Dim r As Integer
Dim s As Integer
Private Sub TextBox1_mouseclick(sender As Object, e As EventArgs) Handles TextBox1.Mouse
ListBox1.Enabled = True
Dim d As Integer
r = Val(TextBox1.Text)
MessageBox.Show("The loop will execute " & r & " times")
s = 0
For i As Integer = 1 To r
d = InputBox("enter the value " & i, "Enter values")
ListBox1.Items.Add(d)
s = s + d
Next i
MessageBox.Show("Total value entered = " & s)
ListBox1.Enabled = False
ListBox1.Items.Clear()
End Sub
End Class

More Related Content

Part19 inputbox using for..loop

  • 1. Visual BASIC .NET 2012 PART 19-INPUTBOX USING FOR..LOOP Dr. GIRIJA NARASIMHAN 1 This slides are available http://slideshare.net /nbgirija
  • 2. Dr. GIRIJA NARASIMHAN 2 This tutorial only for beginners , those who don’t have any knowledge about any programming language skill and application design.
  • 3. Dr.GIRIJA NARASIMHAN 3 Public Class Form5 Dim r As Integer Dim s As Integer Private Sub TextBox1_mouseclick(sender As Object, e As EventArgs) Handles TextBox1.Mouse ListBox1.Enabled = True Dim d As Integer r = Val(TextBox1.Text) MessageBox.Show("The loop will execute " & r & " times") s = 0 For i As Integer = 1 To r d = InputBox("enter the value " & i, "Enter values") ListBox1.Items.Add(d) s = s + d Next i MessageBox.Show("Total value entered = " & s) ListBox1.Enabled = False ListBox1.Items.Clear() End Sub End Class