M
Mr. B
In VB6, I had some code which 'forced' the first character of a string entered
to be Capital. For example, if a person was entering their name (john doe)...
the code would 'force' --- John Doe.
Here is what I believe is the VB6 code:
Private Sub txbModUser_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txbModUser.TextChanged
KeyAscii = AutoType(Screen.ActiveControl, KeyAscii)
End Sub
Public Function AutoType(ByVal c As Control, ByVal KeyAscii As Integer) As
Integer
' Forces Uppercase for First Character in String
AutoType = KeyAscii
If KeyAscii > 95 And KeyAscii < 123 Then
If c.SelStart = 0 Then
AutoType = AutoType - 32
ElseIf Mid$(c.Text, c.SelStart, 1) < "!" Then
AutoType = AutoType - 32
End If
End If
End Function
Is there a way to do this in VB.net?
Also, how can I toggle the Caps Lock Key? I know it's something to do with
"System.Windows.Forms.Keys.CapsLock". But how to test for it on/off?
Thanks!
Bruce
to be Capital. For example, if a person was entering their name (john doe)...
the code would 'force' --- John Doe.
Here is what I believe is the VB6 code:
Private Sub txbModUser_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txbModUser.TextChanged
KeyAscii = AutoType(Screen.ActiveControl, KeyAscii)
End Sub
Public Function AutoType(ByVal c As Control, ByVal KeyAscii As Integer) As
Integer
' Forces Uppercase for First Character in String
AutoType = KeyAscii
If KeyAscii > 95 And KeyAscii < 123 Then
If c.SelStart = 0 Then
AutoType = AutoType - 32
ElseIf Mid$(c.Text, c.SelStart, 1) < "!" Then
AutoType = AutoType - 32
End If
End If
End Function
Is there a way to do this in VB.net?
Also, how can I toggle the Caps Lock Key? I know it's something to do with
"System.Windows.Forms.Keys.CapsLock". But how to test for it on/off?
Thanks!
Bruce