0% found this document useful (0 votes)
33 views

Week 11 Atm Application Using Multiple Forms : Form1 Object Eventargs

The document describes an ATM application created using multiple forms in Visual Basic. It includes the code for 6 forms - Form1, Login, ATMCPLvb, Deposit, Withdraw, and Balance. Form1 loads Login when a button is clicked. Login verifies a PIN and loads ATMCPLvb if correct. ATMCPLvb is the main menu and loads the other forms for deposit, withdraw, and balance transactions when their respective buttons are clicked. Each form handles loading, submitting transactions, and navigating between forms.

Uploaded by

kausar4u
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Week 11 Atm Application Using Multiple Forms : Form1 Object Eventargs

The document describes an ATM application created using multiple forms in Visual Basic. It includes the code for 6 forms - Form1, Login, ATMCPLvb, Deposit, Withdraw, and Balance. Form1 loads Login when a button is clicked. Login verifies a PIN and loads ATMCPLvb if correct. ATMCPLvb is the main menu and loads the other forms for deposit, withdraw, and balance transactions when their respective buttons are clicked. Each form handles loading, submitting transactions, and navigating between forms.

Uploaded by

kausar4u
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Week 11

ATM Application using multiple forms

Public Class Form1


Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
End
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Me.Hide()
login.Show()
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load
Me.TopMost = True
End Sub
End Class

Public Class login


Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
Close()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
If TextBox1.Text = "111" Then
Me.Hide()

ATMCPLvb.Show()
Else
MsgBox("Wrong pin number entered, TRY Again!!!")
TextBox1.Text = ""
TextBox1.Focus()
End If
End Sub
Private Sub login_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load
Me.TopMost = True
End Sub
End Class

Public Class ATMCPLvb


Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
deposit.Show()
Me.Hide()
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles
Button3.Click
Me.Close()
balance.Show()
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
withdraw.Show()
Me.Hide()
End Sub
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles
Button4.Click
MsgBox("Thank you for using the BANK NIZWA ATM Service, GOOD DAY!!")
Me.Hide()
Form1.Show()
End Sub
Private Sub ATMCPLvb_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load
Me.TopMost = True
End Sub
End Class

Public Class deposit


Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Static Bal As Double = 0
Label4.Text = balance.newbalance.Text
MsgBox("you are about to deposit!!, are you sure?")
Bal = Bal + txtbalance.Text
Label4.Text = Bal
balance.newbalance.Text = Bal
txtbalance.Text = ""
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
MsgBox("You are cancelling the deposit Operation and Go to ATM Main Menu?")
ATMCPLvb.Show()
Me.Hide()
End Sub
Private Sub deposit_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load
Me.TopMost = True
End Sub
End Class

Public Class withdraw

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles


Button2.Click
MsgBox("You are cancelling the withdraw Operation and Go to ATM Main Menu?")
ATMCPLvb.Show()
Me.Hide()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Dim AvailBal As Double
If TextBox1.Text <= Val(balance.newbalance.Text) Then
MsgBox("you are about to withdraw the above amount from your account!!,
are you sure to proceed?")
AvailBal = Val(balance.newbalance.Text) - Val(TextBox1.Text)
balance.newbalance.Text = AvailBal
lblBalance.Text = AvailBal
TextBox1.Text = ""
Else
MsgBox("Sorry!,You have Insufficient Balance to proceed this
Transaction!!, Please deposit some money")
ATMCPLvb.Show()
Me.Hide()
End If
End Sub
Private Sub withdraw_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load
Me.TopMost = True
lblBalance.Text = Balance.newbalance.Text
End Sub
End Class

Public Class balance


Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
MsgBox("You are about to Proceed to ATM Main Menu?")
ATMCPLvb.Show()
Me.Hide()
End Sub
Private Sub balance_Load(sender As System.Object, e As System.EventArgs) Handles
MyBase.Load

Me.TopMost = True
End Sub
End Class

You might also like