|
-
Aug 20th, 2000, 04:12 PM
#1
Thread Starter
Frenzied Member
I got 2 questions:
1. how do I allow only small letters into a text box
2. I have text1.text, now the user puts in "hello" I also have 7 labels, go I want label1 to say h label2 to say e label 3 to say l, etc. how do I do it?
thanks in advance
dimava
NXSupport - Your one-stop source for computer help
-
Aug 20th, 2000, 04:16 PM
#2
Frenzied Member
this will allow only small letters (as in not numbers and symbols)
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Chr$(KeyAscii) = UCase(Chr$(KeyAscii)) Then _
KeyAscii = 0
End Sub
this will allow small letters and numbers and symbols
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (Chr$(KeyAscii) = LCase(Chr$(KeyAscii))) Then _
KeyAscii = 0
End Sub
hope it helps
-
Aug 20th, 2000, 04:22 PM
#3
Frenzied Member
Sorry I'm really stupid and missed your second question
you need to make your labels into a control array (call them all label1 but set the index properties from 1 to 7)
then this will work
[code]
Dim i As Integer
'Cut text1 to 7 letters long
If Len(Text1.Text) > 7 Then _
Text1.Text = Left(Text1.Text,7)
'Loop through letters in text1
For i = 1 To Len(Text1.Text)
Label1(i).Caption = Mid$(Text1.Text,i,1)
Next i
[code]
-
Aug 20th, 2000, 04:25 PM
#4
Thread Starter
Frenzied Member
thank you, does anyone have the answer to question2?
NXSupport - Your one-stop source for computer help
-
Aug 20th, 2000, 04:27 PM
#5
Thread Starter
Frenzied Member
sorry, I didn't see your reply to my second question, I forgot to click the refresh button before posting it
NXSupport - Your one-stop source for computer help
-
Aug 20th, 2000, 04:50 PM
#6
Thread Starter
Frenzied Member
11 more question. How come it dosn't work, also it doesn't have anything to do label 2 and label 3 and etc.
NXSupport - Your one-stop source for computer help
-
Aug 20th, 2000, 05:45 PM
#7
Frenzied Member
are you sure, are you getting an error, or just nothing happening?
This might sound really stupid but I just wanna check what yu're doing
when I told you to make the labels into a control array what EXACTLY did you do?
-
Aug 20th, 2000, 07:19 PM
#8
Thread Starter
Frenzied Member
I'm sorry, I didn't read the part that said to make an arry, becuase I printed it out, and it came up on lots of pages, and I needed to use it on another compter, thanks for the help, it all works now
NXSupport - Your one-stop source for computer help
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
|