VB.NET:
Public Class Form1
Public Sub BtnNewAccount_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnNewAccount.Click
Dim a1 As New Account
Dim thisbalance As Integer
thisbalance = a1.getbalance()
a1.accnum = 1
a1.customername = " Harry "
a1.deposit(50)
Call display_account(a1)
End Sub
Sub display_account(ByVal a As Account)
LstShowAccounts.Items.Add(a.accnum & "" & a.customername & "")
End Sub
End Class
------------------------------------------------------------
Public Class Account
Private cAccNum As Integer
Private cBalance As Integer
Private ccustomername As String
Public Property accnum() As Integer
Get
Return accnum
End Get
Set(ByVal newaccnum As Integer)
cAccNum = newaccnum
End Set
End Property
Private Property balance() As Integer
Get
Return cBalance
End Get
Set(ByVal newbalance As Integer)
cBalance = newbalance
End Set
End Property
Public Function getbalance() As Integer
Return balance
End Function
Public Property customername() As String
Get
Return ccustomername
End Get
Set(ByVal newcustname As String)
ccustomername = newcustname
End Set
End Property
Public Function deposit(ByVal amt As Integer) As Integer
cBalance += amt
Return cBalance
End Function
Public Overridable Function withdraw(ByVal amt As Integer) As Integer
cBalance -= amt
Return cBalance
End Function
End Class
anyone know how to display the balance ???? on click ???? would be a massive help . thank you !!
Last edited by a moderator: