Program 4 Write a Vb.net program to accept a number from an user through InputBox and display its multiplication table into the ListBox.

Program 4 Write a Vb.net program to accept a number from an user through InputBox and display its multiplication table into the ListBox.
Solution :
Step 1. Add Windows Form with Name P4.vb
Step 2. Drag and drop Button and List Box control from Toolbox on the form set property Name =btnAcceptNumber and listTable
Step 3. Double click on blank area of form to add page load event
Step 4. Double click on Button
Step 5. Insert following code in the program


Public Class P3
    Dim x, y As Integer
    Private Sub P3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        x = 0
        y = 100
        Timer1.Enabled = True
        Timer1.Start()
    End Sub
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        x += 5
        If x >= Me.Size.Width Then
            x = 0
        End If
        lblMessage.Location = New Drawing.Point(x, y)
    End Sub
End Class

2 comments: