Hey everyone, I got a problem with one of my homeworks. I have to use a Do Until loop until the user enters the right pin in a textbox. However during the loop, I don't know how to allow the user to enter new text into the textbox (it just uses what was written in the textbox and gives error multiple times). I know I can use an input box, but Isn't there a simple way to use the textbox instead?
Here is what I got atm:
Aprreciate any help. Thanks
Here is what I got atm:
Code:
Public Class Form1
Public pin As Integer
Private Sub Bank()
Dim correct_pin As Integer = 1347
Dim Counter As Integer
Do Until pin = correct_pin Or Counter = 3
If pin <> correct_pin Then
Counter += 1
MsgBox("You have entered the wrong pin, you have " & 3 - Counter & " Attempts left")
If Counter = 3 Then
MsgBox("Your card is blocked, please go to your local branch for assistance")
End If
End If
Loop
If pin = correct_pin Then
MsgBox("Welcome to VB Bank")
End If
End Sub
Private Sub Enter_Pin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Start.Click
pin = TxtMessage.Text
Bank()
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtMessage.TextChanged
End Sub
End Class