Share via

Zip Code Program (Visual Basic)

Burke, Brendan J 141 Reputation points
2022-04-06T21:56:42.753+00:00

190647-zip-code-directions.jpg190683-zip-code-designer-window.jpg190705-zip-code-code-editor-window.jpg

The Instruction Docs is the main document that will lead to what I need in my Code editor window which when I run the application should be able to do in the designer window.

Developer technologies | VB

Answer accepted by question author

Jiachen Li-MSFT 34,241 Reputation points Microsoft External Staff
2022-04-07T02:25:52.933+00:00

Hi @Burke, Brendan J ,
Please check the following document to learn about the usage of like operator.
Like Operator (Visual Basic)

And the answer should be like the following code.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click  
        If txtZip.Text Like "4210*[2-4]" Then  
            lblStatus.Text = "Valid Zip"  
        Else  
            lblStatus.Text = "Invalid Zip"  
        End If  
        txtZip.Focus()  
    End Sub  

Best Regards.
Jiachen Li

----------

If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.