Quick intro to .NET validation in VB.NET. Add Textbox1 to your Form. Cut & Paste.

Note that you'll need to add a Button called "cmdCancel". Note that if you even have cmdCancel with *focus* after screwing up entry into TextBox1 (so, for example, you tab off of TextBox1 into Cancel), the validation won't happen. Haven't messed much yet with when events fire (can you get a click from cmdCancel before validation happens, etc).

    Private Sub TextBox1_Validating(ByVal sender As Object, _
        ByVal e As System.ComponentModel.CancelEventArgs) Handles _
        TextBox1.Validating

        Dim strQaMsg As String
        
        strQaMsg = ""

        If Not ActiveControl Is cmdCancel Then

            If TextBox1.Text.Length < 4 Then
                e.Cancel = True
                strQaMsg = "TextBox1's text length " & _
                    "must be at least four characters long"
            End If
        End If

        If e.Cancel Then
            MsgBox(strQaMsg, MsgBoxStyle.Exclamation, _
                "Data entry validation issue")

        End If

    End Sub