|
-
Feb 4th, 2000, 02:34 AM
#1
Thread Starter
Hyperactive Member
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
-
Feb 4th, 2000, 03:02 AM
#2
On the KeyPress Event use:
Code:
If Len(Text1.Text) > 5 Then
Text1.Text = Left(Text1.Text, 5)
Text1.SelStart = 5
End If
------------------
Boothman
There is a war out there, and it is about who controls the information, it's all about the information.
-
Feb 4th, 2000, 07:38 AM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|