469,150 Members | 1,973 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,150 developers. It's quick & easy.

VB6.0 : Setting textbox to Caps Lock

wassup
34
Hi all,

I need a help again. How to set the textbox auto change to Upper Case without on the Caps Lock Key.
May 14 '07 #1
7 18085
Dököll
2,364 Expert 2GB
Hi all,

I need a help again. How to set the textbox auto change to Upper Case without on the Caps Lock Key.
Hiya, wassup!

I think it's somewhere in the line of :

Expand|Select|Wrap|Line Numbers
  1.  
  2. UCase(Text1.Text)
  3.  
  4.  
What is this for anyway?

You may also need SelStart in there

Expand|Select|Wrap|Line Numbers
  1.  
  2. Text1.Text = UCase$(Text1.SelStart)
  3.  
  4.  
Check it, I am typing this up from memory, but SelStart makes it that whatever is typed in according to the case specified.

Dököll
May 14 '07 #2
wassup
34
hi Dokoll,

i have try but its not working. its that key in at Form_load()?
May 14 '07 #3
Killer42
8,435 Expert 8TB
Try this...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Text1_KeyPress(KeyAscii As Integer)
  2.   Select Case KeyAscii
  3.     Case 97 To 122
  4.       KeyAscii = KeyAscii - 32
  5.   End Select
  6. End Sub
May 14 '07 #4
wassup
34
Try this...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Text1_KeyPress(KeyAscii As Integer)
  2.   Select Case KeyAscii
  3.     Case 97 To 122
  4.       KeyAscii = KeyAscii - 32
  5.   End Select
  6. End Sub
thanks killer. i got another source code too.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtPro_KeyPress(KeyAscii As Integer)
  2.    KeyAscii = Asc(UCase(Chr(KeyAscii)))
  3. End Sub
May 14 '07 #5
Killer42
8,435 Expert 8TB
thanks killer. i got another source code too.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtPro_KeyPress(KeyAscii As Integer)
  2.    KeyAscii = Asc(UCase(Chr(KeyAscii)))
  3. End Sub
Good idea. My version will be very language-specific. The Ucase function might be a bit smarter.
May 14 '07 #6
@Killer42
Thanks it's working..
Mar 2 '13 #7
Your idea works good..
Feb 19 '14 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

18 posts views Thread by Robert | last post: by
4 posts views Thread by Peter D | last post: by
3 posts views Thread by Mike L | last post: by
6 posts views Thread by Morten Dahl | last post: by
1 post views Thread by Brian Parker | last post: by
5 posts views Thread by Muhammad Ahsin Saleem | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.