|
-
May 12th, 2011, 09:17 AM
#1
Thread Starter
Member
text box String Loop Issue
Hey peeps
im having an issue, im new to visual basic and dont know very much so im attempting a problem solving exercises from college to learn more.
i need it so my form 1 : text box the user enters a name and if they dont enter a name or if they enter wrong characters it loops and keeps asking them, if they enter a proper name it launches form2
this is my code i have made for it so far but its not working right. can someone help me out ?
Where i have " String " that dosnt work i need something in there i think, so that if 3 + any string characters it accepts as a name if that makes sence..
Public Class Form1
Dim Scores As Integer
Dim username As String
Private Sub BtnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStart.Click
username = txtname.Text
Do Until txtname.Text = " String "
If txtname.Text = "" Then MsgBox(" you must enter your name")
If IsNumeric(txtname.Text) Then MsgBox(" please enter letters")
Exit Do
Loop
Me.Hide()
Form2.Show()
End Sub
Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|