Quick Search for:  in language:    
Ensures,characters,text,uppercase,even,Caps,L
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,290,928. lines
 Jobs: 207. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for Visual Basic.
Control By Browser
By Priyan R on 12/30


Stealth Exchange SFX
By dvchaos on 12/30


Click here to see a screenshot of this code!Mini Tetris
By Code Toad on 12/30

(Screen Shot)

Click here to see a screenshot of this code!NTMessager Network Message Utility
By B.Cem HANER on 12/30

(Screen Shot)

Math-Game
By Angelica Courtin on 12/30


Click here to see a screenshot of this code!Encryptor Xor Version 3
By DISTS on 12/30

(Screen Shot)

Click here to see a screenshot of this code!Stretch Image Two Times !! (Using GetPixel and SetPixel)
By Skinny Ugly Guy on 12/30

(Screen Shot)

Simple FileFind Class Object
By David Jonathan Messervey on 12/29


Font Rotator Module
By Lyox Soft on 12/29


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Ensures all the characters in a text box are uppercase

Print
Email
 

Submitted on: 11/21/2003 4:10:50 AM
By: Donita Ertekin 
Level: Beginner
User Rating: By 1 Users
Compatibility:VB 3.0, VB 4.0 (16-bit), VB 5.0, VB 6.0, ASP (Active Server Pages) , VBA MS Access, VBA MS Excel

Users have accessed this code 323 times.
 
 
     Ensures all the characters in a text box are uppercase even if you do not set the Caps Lock key
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Ensures all the characters in a 
'     text box are uppercase
' Description:Ensures all the characters
'     in a text box are uppercase even if you 

'     do not set the Caps Lock key
' By: Donita Ertekin
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=50025&lngWId;=1'for details.'**************************************

'Place A text Box in a Form and name it 
'     as txt and copy this code in the Code wi
'     ndow and check

Private Sub txt_KeyPress(KeyAscii As Integer)

Select Case KeyAscii Case 97 KeyAscii = 65 Case 98 KeyAscii = 66 Case 99 KeyAscii = 67 Case 100 KeyAscii = 68 Case 101 KeyAscii = 69 Case 102 KeyAscii = 70 Case 103 KeyAscii = 71 Case 104 KeyAscii = 72 Case 105 KeyAscii = 73 Case 106 KeyAscii = 74 Case 107 KeyAscii = 75 Case 108 KeyAscii = 76 Case 109 KeyAscii = 77 Case 110 KeyAscii = 78 Case 111 KeyAscii = 79 Case 112 KeyAscii = 80 Case 113 KeyAscii = 81 Case 114 KeyAscii = 82 Case 115 KeyAscii = 83 Case 116 KeyAscii = 84 Case 117 KeyAscii = 85 Case 118 KeyAscii = 86 Case 119 KeyAscii = 87 Case 120 KeyAscii = 88 Case 121 KeyAscii = 89 Case 122 KeyAscii = 90 Case Else KeyAscii = 0 End Select
End Sub


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
11/21/2003 4:34:50 AM:korejwa
That's an awfully complicated way of 
subtracting 32 from KeyAscii if it's 
withing a certain range.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 4:39:12 AM:korejwa
... You'd think there would be a better 
way.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 4:44:41 AM:Peter H
Private Sub Text1_Change()              
Text1.Text = UCase(Text1.Text)        
Text1.SelStart = Len(Text1)         
End Sub                           
      
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 7:17:07 AM:_Merlin_
How about this one?
Private Sub 
Text1_KeyPress(KeyAscii As Integer)
KeyAscii = 
Asc(UCase(Chr(KeyAscii)))
End 
Sub
Merlin is the name, and logic is 
my game...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 7:18:06 AM:_Merlin_
Seems the formatting got scr*wed up 
again :(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 9:28:17 AM:ReadError
You can do it with API too 
:)
Private Const GWL_STYLE As Long = 
-16
Private Const ES_UPPERCASE As Long 
= &H8&
Private Declare Function 
GetWindowLong Lib "user32.dll" Alias 
"GetWindowLongA" (ByVal hwnd As Long, 
ByVal nIndex As Long) As Long
Private 
Declare Function SetWindowLong Lib 
"user32.dll" Alias "SetWindowLongA" 
(ByVal hwnd As Long, ByVal nIndex As 
Long, ByVal dwNewLong As Long) As 
Long
Private Sub Form_Load()
Dim 
lngStyle As Long
    lngStyle = 
GetWindowLong(Text1.hwnd, GWL_STYLE)
  lngStyle = lngStyle Or ES_UPPERCASE
   SetWindowLong Text1.hwnd, GWL_STYLE, 
lngStyle
End Sub
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 11:21:15 AM:C.Smith
Jeebus! Peter pointed out the easiest 
way to do this. The end.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 3:24:32 PM:VB Bob
I can only hope that this is a joke.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/22/2003 2:09:33 AM:A Allen
WAIT I GOT ONE!!!!
Private Sub 
Text1_KeyPress(KeyAscii As 
Integer)
KeyAscii = KeyAscii - 32
End 
Sub
I WIN 3 LINES!!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/22/2003 2:33:06 AM:korejwa
This Select Case statement subtracts 32 
from KeyAscii if it's within a certain 
range:
If KeyAscii > 96 And KeyAscii < 
123 Then KeyAscii = KeyAscii - 32
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/22/2003 7:13:01 AM:
Text1.Text = Format(Text1.Text, 
">")
Is there are record for the 
number of different ways you can 
perform one action.  Think we might be 
close.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/27/2003 3:15:32 AM:Ståle Freyer
As you can see of my name, we 
Norwegians use letters outside the a-z 
range. Only the "API" and and "Ucase"- 
solution stated above will handle these 
letters correctly. Subtracting 32 from 
the ascii-values of the minuscles is 
substandard programming. This entry 
with "Select case" is below any 
standard.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.