Keep in mind I am very much so a beginner.....
I am making a simple little Vending Machine.. if you picture the keypad on most vending machines you will get the idea of what I am trying to build.....I have selection buttons 2 letters and 2 numbers. "A, B, 1, 2"
I have a textbox that as you push each button will display your selection.....I am having a problem with the numbers..the first "letter" selection is easy and if you push the letter A and then hit B it will just replace the text in the box.....what I am not able to figure out is how to make it do the same thing for the numbers...the second entry. here is my code.....
Private Sub Abutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Abutton.Click
SelectionText.Text = "A"
End Sub
Private Sub Bbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bbutton.Click
SelectionText.Text = "B"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If String.IsNullOrEmpty(SelectionText.Text) Then
MsgBox("Please select A-F first")
SelectionText.Text = ""
Else
SelectionText.Text = SelectionText.Text & "1"
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If String.IsNullOrEmpty(SelectionText.Text) Then
MsgBox("Please select A-F first")
SelectionText.Text = ""
Else
SelectionText.Text = SelectionText.Text & "2"
End If
End Sub
I dont want to be able to keep pushing one of the number buttons and keep adding digits to the end of what is there already...
Thanks for any help!
This post has been edited by newsledder: 05 November 2009 - 10:11 PM

New Topic/Question
Reply




MultiQuote





|