Sub EditText1_TextChanged (Old As String, New As String)
Dim pline As String
pline = EditText1.Text
If pline.Length > 39 Then
EditText1.Text = pline.SubString2(0,39) ' Set the EditText to the first 40 characters
EditText1.SelectionStart = 39 ' this places the cursor at the end of the text string
' insert code to trigger phone vibrate or display toastmessage
End If
End Sub