|
-
Oct 3rd, 2000, 02:02 PM
#1
Thread Starter
Frenzied Member
is there a way to lock just part of a text box
like let say 3 first letter of the text box
-
Oct 3rd, 2000, 02:04 PM
#2
Fanatic Member
Can you tell us more about your program. Maybe there are other way's to do the same thing.
-
Oct 3rd, 2000, 02:13 PM
#3
Fanatic Member
Here You Go.
Code:
Private Sub Form_Load()
Text1.Tag = Left(Text1.Text, 3)
End Sub
Private Sub Text1_Change()
If Left(Text1.Text, 3) <> Text1.Tag Then
Text1.Text = Text1.Tag & Mid(Text1.Text, 3)
Text1.SelStart = 3
End If
End Sub
Just change the 3 to any number of characters you'd like to make write protected
-
Oct 3rd, 2000, 02:17 PM
#4
Set the Textbox's MaxLength property to 3.
Code:
Private Sub Form_Load()
Text1.MaxLength = 3
End Sub
Or you can use this way:
Code:
Private Sub Text1_Change()
If Len(Text1.Text) = 3 Then Text1.Locked = True
End Sub
-
Oct 3rd, 2000, 02:19 PM
#5
Thread Starter
Frenzied Member
that's genius
tanx a lot ExcalibursZone
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
|