0
這裏我有一個基本的銀行賬戶,允許用戶輸入他們的借方和貸方金額以及每筆金額的備忘錄。用戶也可以顯示所有交易及其餘額。我無法顯示所有交易,也無法創建一個方程式來減去信用借方。這是迄今爲止我所擁有的,因爲我已經堅持了幾個小時。從文本框中存儲多個用戶輸入並從文本框中添加多個值?
Public Class Form1
Dim valueDebit As Decimal
Dim valueCredit As Decimal
Dim total As Decimal
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Text = "Mike Smith's Bank Account"
Lb1.Visible = False
Lb2.Visible = False
Lb3.Visible = False
Tb1.Visible = False
Tb2.Visible = False
Bt1.Visible = False
End Sub
Private Sub Cb1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles Cb1.SelectedIndexChanged
If Tb1.Text = "" Then
Tb1.Text = "0.00"
ElseIf Cb1.Text = "Credit" Then
Lb1.Visible = True
Lb2.Visible = True
Lb3.Visible = False
Tb1.Visible = True
Tb2.Visible = True
Lb1.Text = "Enter Credit Amount"
Lb2.Text = "Describe the Income"
Bt1.Visible = True
valueCredit = Convert.ToDecimal(Tb1.Text)
ElseIf Cb1.Text = "Debit" Then
Lb1.Visible = True
Lb2.Visible = True
Lb3.Visible = False
Tb1.Visible = True
Tb2.Visible = True
Lb1.Text = "Enter Debit Amount"
Lb2.Text = "Describe the Expense"
Bt1.Visible = True
valueDebit = Convert.ToDecimal(Tb1.Text)
ElseIf Cb1.Text = "Display Transactions" Then
Lb1.Visible = False
Lb2.Visible = False
Lb3.Visible = True
Tb1.Visible = False
Tb2.Visible = False
Bt1.Visible = False
ElseIf Cb1.Text = "Display Balance" Then
Lb1.Visible = False
Lb2.Visible = False
Lb3.Visible = True
Tb1.Visible = False
Tb2.Visible = False
Lb3.Text = "$"
End If
End Sub
Private Sub Bt1_Click(sender As Object, e As EventArgs) Handles Bt1.Click
Cb1.Text = ""
Tb1.Visible = False
Tb2.Visible = False
Lb1.Visible = False
Lb2.Visible = False
Tb1.Text = ""
Tb2.Text = ""
End Sub
End Class
任何幫助,將不勝感激。