-
how can i check if the text entered in a textbox exceeds the limit of the textbox. What i actually mean is that when the multi line option is disabled, then the textbox scrolls horizontally if the limit exceeds. How can i check if this happened (i.e. the textbox scrolled horizontally)
-
Try this
Code:
If TextWidth(Text1) >= Text1.Width - 60 Then
MsgBox "I'm too long"
End If
-
You might be better off setting the maxlength property to prevent too much text from being entered.
Either do it at design time or use this line.
textbox1.maxlength=60
-
but i dont want to limit the text, i just want to know if the limit exceeds. thanks MartinLiss, it works just fine.