- Home
·
- String Manipulation
·
- Validates value user enters into TextBox control for telephone number entry is valid. Format should
Validates value user enters into TextBox control for telephone number entry is valid. Format should
Validates value user enters into TextBox control for telephone number entry is valid. Format should be 999-999-9999.
API Declarations
Dim PN As String
Rate Validates value user enters into TextBox control for telephone number entry is valid. Format should
(1(1 Vote))
'Set txtPNBox.Text lenghth to 12.
'Generate/display successful message for correct phone number format
'Generate/display unsuccessful message for incorrect phone number format
If txtPNBox.Text.Length() = 12 Then
MsgBox("Your number is correct.")
txtPNBox.Text = ""
Return
End If
If txtPNBox.Text.Length() <> 12 Then
MsgBox("Sorry! Your number format is incorrect. Please enter a valid number, e.g., 999-999-9999.")
Return
End If
End Sub
Private Sub txtInputNum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPN.TextChanged
End Sub
Private Sub txtPNBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPNBox.TextChanged
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub lblPN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblPN.Click
End Sub
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub mnuEditItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuCloseItem.Click
'Set close menu to end session by returning a pleasant "Thank you" before exiting
If txtPNBox.Text = "" Then
MsgBox("Thank you and have a blessed day, good-bye!")
End
End If
End Sub
End Class
Validates value user enters into TextBox control for telephone number entry is valid. Format should Comments
No comments yet — be the first to post one!
Post a Comment