Results 1 to 3 of 3

Thread: Cabs On

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    13
    What should I do to enable Cabs Lock On for my whole program so that all the characters typed in any textbox appear in UpperCase?
    N.M.

  2. #2
    Guest
    You can use this code to have any text typed into a textbox in uppercase, without using the CAPS key.

    Code:
    Private Sub Text1_Change()
        Text1 = UCase(Text1)
        Text1.SelStart = Len(Text1.Text)
    End Sub
    Sunny

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    ' Remarks:
    'the code will have to go in every textbox keypress event
    'either of these will work..use the one you choose
    ' Allow only alpha data in a text box
    '
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    
    If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Then
        KeyAscii = KeyAscii
        Else
        KeyAscii = 0
    End If
    End Sub
    ' OR
    
    'This should also uppercase other letters like åäöüê... 
    
    Private Sub Text1_KeyPress(KeyAscii As Integer)
       KeyAscii = KeyAscii and -33
    End Sub
    
    ' OR 
    
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End Sub
    [/code]

    [Edited by HeSaidJoe on 11-18-2000 at 09:10 AM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width