Results 1 to 3 of 3

Thread: Not too hard :)

  1. #1

    Thread Starter
    Member lllld_bllll's Avatar
    Join Date
    Dec 2001
    Location
    In The Hell , Die and visit me :D
    Posts
    42

    Smile Not too hard :)

    hi,
    i'm having a problem in preventing someone to type a letter in the textbox.
    I don't want the user to type any letter, even the capital or not capital .
    also i want a way to let the "Caps Lock" used by the user from a command in the form .
    thanks,
    lllld_bllll
    ....... You'll Never Know

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    
    If KeyAscii > 64 And KeyAscii < 123 Then KeyAscii = 0
    
    End Sub
    your second question makes no sense
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Halifax,UK
    Posts
    274
    you need to enable ascii 92-95 tho'

    VB Code:
    1. If (KeyAscii > 64 And KeyAscii < 91) Or (KeyAscii > 96 And KeyAscii< 123) Then
    2.     KeyAscii = 0
    3. End If

    you also need to disable pasting...

    VB Code:
    1. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    2. If Shift = 2 And KeyCode = 86 Then
    3.     Clipboard.Clear
    4. End If
    5. End Sub
    VB6 VS2005

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