Is it possible to limit the lengh of the text written in the inputbox ? (like at a text box Text1.MaxLengh = 5).
Note: For this programm I use VB 3.0, but I have 6.0 too. (new)
Thanx for some help, Matt ;)
:P
Printable View
Is it possible to limit the lengh of the text written in the inputbox ? (like at a text box Text1.MaxLengh = 5).
Note: For this programm I use VB 3.0, but I have 6.0 too. (new)
Thanx for some help, Matt ;)
:P
On the KeyPress Event use:
------------------Code:If Len(Text1.Text) > 5 Then
Text1.Text = Left(Text1.Text, 5)
Text1.SelStart = 5
End If
Boothman
Quote:
There is a war out there, and it is about who controls the information, it's all about the information.
Well an InputBox doesn't have a KeyPress event. It's not elegant, but what I do is to check the length of the reply, and tell the user to re-enter it. This can be done inside a Do loop that loops until Len(strYourUserResponse) < 5.
------------------
Marty
HASTE CUISINE
Fast French food.