Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = ""
TextBox1.MaxLength = 13
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If (TextBox1.Text).Length < 13 Then
Label1.Text = "ข้อมูลยังไม่ครบ 13 ตัว"
Else
Label1.Text = ""
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (TextBox1.Text).Length < 13 Then
MsgBox("กรอกข้อมูลให้ครบ")
Return
End If
End Sub
End Class