ATM PIN code for VB.net Project

ATM PIN code for VB.net Project

Page 1 of 1

2 Replies - 12896 Views - Last Post: 07 March 2009 - 09:56 AM Rate Topic: -----

#1 gareth88  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 07-March 09

ATM PIN code for VB.net Project

Posted 07 March 2009 - 07:31 AM

I am coding an ATM interface for a VB.net project. I wish to use command buttons to enter the code, just like one would do so at an actual ATM. I am using 4 separate labels or text boxes (whichever is more convenient), to print the separate numbers to, once the command buttons are clicked by the user.

The problem I am having is that once the 1st button is clicked, it is continually being overwritten, by clicking a second button. I have tried making the labels or text boxes... enabled = False, but it is still overwritten when the second button is clicked. Is there any means of bypassing this problem and getting the first label or text box locked off, after the first click?

Is This A Good Question/Topic? 0
  • +

#3 F!st!cuffs  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 153
  • Joined: 15-July 08

Re: ATM PIN code for VB.net Project

Posted 07 March 2009 - 08:31 AM

It's hard to say what the problem is without seeing the code you have for the click events. If I were to guess I'd say that your code looks like this.

' Button 1'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Button1.Click
	Textbox1.Text = "1"
End Sub 
' Button 2'
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Button1.Click
	Textbox1.Text = "2"
End Sub 



When you do it this way you are assigning the value n to the object Text, so it will overwrite the existing value. What you want to do is append which can be achieved by using += instead of just =.
Was This Post Helpful? 1

#4 gareth88  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 07-March 09

Re: ATM PIN code for VB.net Project

Posted 07 March 2009 - 09:56 AM

Yeah, that works perfectly. Knew it was going to be something very simple. Thanks for that. Much appreciated.
Was This Post Helpful? 1

Page 1 of 1