CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Smile VB.NET Windows form app (ATM) Help

    Hi, iv'e been ask to do an atm app.
    Really simple:

    Username:
    Password:


    OK (Button) Exit (button)

    With 3 options:

    Deposit:
    Withdraw:
    Balance:

    I did the form design, but i don't know where to star the code

    Please help i'm new at this.
    Sorry for my bad English.

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB.NET Windows form app (ATM) Help

    Start with writing code to verify the user and password then add code for the math required for the changes and then the display
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Feb 2012
    Posts
    6

    Re: VB.NET Windows form app (ATM) Help

    ok i started by filling user and pass press the ok button when those are filled the options appear(deposit, balance..) if not a messagebox says please enter user...

    but i'm having trouble with the code since i dont know how get value from the textbox

    what do i need to code to get that when i pressed the ok button

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: VB.NET Windows form app (ATM) Help

    if your textbox has the default name of TextBox1 then you would get the value by using TextBox1.Text If you named the textbox yourself then use whatever name you gave it in place of the TextBox1 portion. the .Text property lets you get or set the text in the control.
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Feb 2012
    Posts
    6

    Re: VB.NET Windows form app (ATM) Help

    I DID IT, THANKS
    I DID SOME RESEARCH.
    ITS NOT THAT COMPLEX BUT HERE IT IS TO SHARE IT.



    Public Class Form1






    Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnok.Click
    If txtname.Text = "" And txtpass.Text = "" Then

    MessageBox.Show("Enter Username and Password", "Message")
    Else
    lbldep.Visible = True
    lblw.Visible = True
    lblbal.Visible = True
    txtbal.Visible = True
    txtdep.Visible = True
    txtw.Visible = True
    btncont.Visible = True


    End If
    End Sub

    Private Sub btncont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncont.Click
    btnprint.Visible = True

    If txtdep.Text = "" And txtw.Text = "" Then
    MessageBox.Show("Enter Amount", "Message")

    Else
    Dim balance As Integer

    balance = Val(txtdep.Text) - Val(txtw.Text)
    txtbal.Text = balance




    End If


    End Sub

    Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click

    Dim retCode As Integer = 0

    System.Environment.Exit(retCode)

    End Sub
    End Class

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured