我有一個投資回報申請,它將花費投資金額並每年返回總收入的5%,並在ListBox
中顯示每年的結果。我沒有收到任何錯誤,但GUI不顯示列表框中的投資收益率。任何建議,將不勝感激。這是我到目前爲止的代碼:預期值不會顯示在列表框中
Public Class Form1
Const Interest_Rate As Double = 0.05
Private Sub btncmdCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncmdCalculate.Click
Dim num_years As Integer
Dim intCounter As Integer
Dim current_value As Double
Dim future_amount As Double
current_value = Val(txtcurrent_value.Text)
num_years = Val(txtnum_years.Text)
current_value = current_value * Interest_Rate * num_years & vbTab _
'calculate amount
For intCounter = 1 To num_years
future_amount = current_value * (1 + Interest_Rate)^intCounter
lstBalances.Text = current_value * Math.Pow(1 + Interest_Rate, intCounter) & "" & _ vbTab & FormatCurrency(current_value)"
Next intCounter
End Sub