VB6 Testo maiuscolo in una textbox

di Anonimizzato2851 il
2 risposte
Come posso impostare la funzione che quando digito una parola in una textbox essa divanta direttamente con le lettere maiuscole
ringrazio anticipatamente

Se la montagna viene da te e te non ti chiami Maometto, scappa è una frana!!!

2 Risposte

  • Ciao potresti fare una cosa del genere:
    1) Dichiara le 3 costanti
    Private Const CHAR_LOWER_A As Integer = 97
    Private Const CHAR_LOWER_Z As Integer = 122
    Private Const CHAR_STEP As Integer = 32

    2) crea la funzione:
    Private Function MakeToUpper(KeyAscii As Integer) As Integer

    If (KeyAscii >= CHAR_LOWER_A And KeyAscii <= CHAR_LOWER_Z) Then
    KeyAscii = KeyAscii - CHAR_STEP
    End If

    MakeToUpper = KeyAscii

    End Function

    3) nell' evento OnKeyPress tella textbox scrivi (es:)
    Private Sub Text1_KeyPress(KeyAscii As Integer)

    KeyAscii = MakeToUpper(KeyAscii)

    End Sub


    Spero sia quello che cerchi
  • Funziona grazie ghost

    Se la montagna viene da te e te non ti chiami Maometto, scappa è una frana!!!
Devi accedere o registrarti per scrivere nel forum
2 risposte