Good Day, i am wring one program. The program purpose is when the textbox detect textbox word is out of limit it can't to continue writing and it will pop out a error message. Below is my code can someone help me take a look.
Dim i As Integer
txtCN.MaxLength = 15
i = txtCN.MaxLength
If txtCN.Text.Length > i Then
MessageBox.Show("Maximum is 15 Character", "Error Message")
End If
txtCN.MaxLength = 15
i = txtCN.MaxLength
If txtCN.Text.Length > i Then
MsgBox("Maximum is 15 Character")
End If