Results 1 to 4 of 4

Thread: How to auto capital the letter in textbox ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Malaysia
    Posts
    69
    Is there a property that I can use to set the Textbox to show capital alphabet even if I type using lower case ?



  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Try this code

    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii < "97" Or KeyAscii > "122" Then
      KeyAscii = KeyAscii
    Else
      KeyAscii = KeyAscii - 32
    End If
    End Sub
    Hope this helps

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Code:
    Private Sub Text1_Change()
      Dim lng_Pos As Long
      lng_Pos = Text1.SelStart
      Text1.Text = UCase(Text1.Text)
      Text1.SelStart = lng_Pos
    End Sub

  4. #4
    Guest
    Code:
    Proper Case:
    Text1.text = StrConv(Text1, vbProperCase)
    Lcase:
    Text1.text = StrConv(Text1, vbLowerCase)
    Ucase:
    Text1.text = StrConv(Text1, vbUpperCase)

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