這段代碼編寫使得這些聲明進入列表框,但不幸的是,當它運行時,它只顯示帳號而不顯示其他內容。我試圖找出我做錯了什麼,但無法弄清楚。創建一個自動櫃員機的顯示代碼
Dim Loan As Decimal
Dim Account_Number, CustomerName, OpeningBalance, CurrentBalance, Loan_Taken, Amount_of_Loan, Amount_Deposited As String
If OneAccount.LoanTaken Then
Loan = OneAccount.CustomerLoan
Account_Number = TextBox1.Text
CustomerName = TextBox2.Text
OpeningBalance = Val(TextBox3.Text)
CurrentBalance = Val(TextBox3.Text) - Val(TextBox5.Text)
Label8.Text = CurrentBalance
If CheckBox1.Checked = True Then
Loan_Taken = "Yes"
Else
Loan_Taken = "No"
End If
Amount_of_Loan = Format(Loan, "Currency")
Amount_Deposited = Label8.Text
Amount_Deposited = Amount_Deposited
Amount_Deposited = Format(Amount_Deposited, "Currency")
ListBox2.Items.Add(String.Format(Account_Number, CustomerName, OpeningBalance, CurrentBalance, Loan_Taken, Amount_of_Loan, Amount_Deposited))
End If
https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ – Jens