Advertisement
4_2005-2006 VB function enhancement #150551

Numerical input into text box (1 line of code)

With this 1 line of code you can strip non-numerical input into text boxes.

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.

Исходный код
original-source
Private Sub Text1_KeyPress(KeyAscii As Integer)
' Force numbers only in a text box
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End Sub
Оригинальные комментарии (3)
Восстановлено из Wayback Machine