CISA FotoGallery

Statistiche

Tot. visite contenuti : 928188
Home Articoli tecnici Moduli Controllo Digitazioni

Controllo Digitazioni

CODICE

Public Function CkDgtNumber(KeyAscii As Integer, _
                        nMin as Integer, _
                        nMax As Integer) As Integer
    
'=========================================
    'Verifica che venga inserito un NUMERO
    'dove nmax =Numero Limite
    'Da inserire nell'EVENTO KEY_PRESS
    '48-57
    '=========================================
    
CkDgtNumber = 30
    If KeyAscii >= 48 + nmin And _
        KeyAscii <= 48 + nMax Then CkDgtNumber = KeyAscii
    Select Case KeyAscii
        Case 44, 45
            CkDgtNumber = KeyAscii
        Case vbKeyBack, vbKeyTab, vbKeyClear, vbKeyReturn
            CkDgtNumber = KeyAscii
        Case vbKeyEscape, vbKeyDelete, vbKeyNumlock
            CkDgtNumber = KeyAscii
    End Select
End Function



Public Function
CkDgtWord(KeyAscii As Integer) As Integer
    
'=========================================
    'Verifica se il TASTO PREMUTO è una lettera
    'Va inserita nell'EVENTO KEY_PRESS
    '65-90(Maiuscole) 97-122(Minuscole)
    '=========================================
    
CkDgtWord = 30
    If ((KeyAscii >= 65 And _
        KeyAscii <= 90) Or _
        (KeyAscii >= 97 And _
        KeyAscii <= 122)) Then _
        CkDgtWord = KeyAscii
    Select Case KeyAscii
        Case vbKeyBack, vbKeyTab, vbKeyClear, vbKeyReturn, vbKeyShift
            CkDgtWord = KeyAscii
        Case vbKeyEscape, vbKeySpace, vbKeyDelete, vbKeyNumlock
            CkDgtWord = KeyAscii
    End Select
End Function