CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Shift Keypress

  1. #1
    Join Date
    Apr 2001
    Location
    Lincs, UK
    Posts
    16

    Shift Keypress

    I need to be able to stop users using the shift key. This is to stop the use of Uppercase letters.
    I can't use the Ucase$ statement because I need to change Vowel letters into capitals by using code.


  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Shift Keypress

    An easy way would be to trap on the Keypress event and convert Upper case keystrokes to lower case.
    Here is a small example using a TextBox

    private Sub Text1_KeyPress(KeyAscii as Integer)
    Debug.print KeyAscii
    If KeyAscii > 64 And KeyAscii < 91 then KeyAscii = KeyAscii Or &H20
    End Sub




    John G

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

Featured