63 218
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #20862 in Visual Basic for mohammad

Question #20862
design a vb form, the user will enter a number & then click the button, the result should display in list box the multiplication table of your number (by the numbers 1 to 10)...
what is the code for this question??
Expert's answer
Public Class Form1



Private Sub txtUpperlimit_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtUpperlimit.TextChanged

resultListBox.Items.Clear()



End Sub

''' <summary>

''' Calculate button

''' </summary>

''' <param name="sender"></param>

''' <param name="e"></param>

''' <remarks></remarks>

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

Try

Dim counter As Integer = 1

resultListBox.Items.Clear()

resultListBox.Items.Add("N" + vbTab + "N^2" + vbTab +
"N^3")

Do Until counter > Integer.Parse(txtUpperlimit.Text)

resultListBox.Items.Add(counter.ToString() + vbTab + Math.Pow(counter,
2).ToString() + vbTab + Math.Pow(counter, 3).ToString())

counter += 1

Loop

Catch ex As Exception

MessageBox.Show("Incorrect data")

End Try



End Sub



End Class

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions