You are on page 1of 1

Creamos una funcion que puede ir en un modulo para puedas utilizarla en cualquie

r parte del programa:


Function SoloMayusculas(ByVal KeyAscii As Integer) As Integer
If KeyAscii > 96 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32 ' Con el if vemos si el numero de tecla presi
onada y si esta en minuscula la transforma a mayuscula.
End If
SoloMayusculas = KeyAscii ' Luego se entrega el resultado a la funcion para reto
rnarla
End Function
Private Sub Text1_KeyPress(KeyAscii As Integer)
' Y en el evento KeyPress de los TextBox se coloca lo siguiente:
KeyAscii = SoloMayusculas(KeyAscii)
End Sub

You might also like