Advertisement
ASP_Volume2 Miscellaneous #36650

Allow Numbers

Allow only numbers along with one deciaml.

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
'***********************************************************
' This code only allows numbers along with one decimal
' point in text box named txtNumber. Also allow backspace.
'***********************************************************
    
  If KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Or KeyAscii = 46 Then
    If KeyAscii = 46 Then
      If InStr(txtNumber.Text, ".") Then
        KeyAscii = 0
        Exit Sub
      Else
        txtNumber.Text = txtNumber.Text
      End If
    Else
    End If
    
  Else
    KeyAscii = 0
  End If
Commenti originali (3)
Recuperato da Wayback Machine