Advertisement
6_2008-2009 VB function enhancement #195587

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

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에서 복구됨