Question
Visual Basic 2017 Community Modify the interface to allow the user to select the term (15, 20, 25 or 30) from a list box. Make
Visual Basic 2017 Community
Modify the interface to allow the user to select the term (15, 20, 25 or 30) from a list box. Make any other modifications you deem necessary to the interface. Be sure to reset the tab order. Also be sure to select a default item in the new list box. The Calculate button should now display only the monthly payment corresponding to the selected term. Save the solution and then start and test the application. (If the principal, rate, and term are 125000, 3.0, and 30, respectively, the monthly payment is $527.01.
This is my code i am confused on where to start like either create new buttons which is my idea but i dont think that is how it should be done.
`
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
' Fill list box with rates and select 3.0 rate.
For dblRates As Double = 2 To 7 Step 0.5
lstRates.Items.Add(dblRates.ToString("N1"))
Next dblRates
lstRates.SelectedItem = "3.0"
End Sub
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
' Display the monthly mortgage payment.
Dim intPrincipal As Integer
Dim dblRate As Double
Dim dblPay As Double
Integer.TryParse(txtPrincipal.Text, intPrincipal)
Double.TryParse(1StRates.SelectedItem.ToString, dblRate)
dblRate = dblRate / 100
lblPay.Text = String.Empty
For IntTerm As Integer = 15 To 30
dblPay = -Financial.Pmt(dblRate / 12, IntTerm * 12, intPrincipal)
lblPay.Text = lblPay.Text & IntTerm.ToString &
"years: " & dblPay.ToString("C2") & ControlChars.NewLine
Next IntTerm
End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started