Advertisement
6_2008-2009 Files/ File Controls/ Input/ Output #207777

TextBox - Only Accept Numbers

This short little code example shows you how to only accept numbers to be inputed into a textbox by using the KeyPress event procedure. This is beginner, but I've seen alot of people that don't know how to do this.

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 txtHoursDay_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtHoursWeek.KeyPress
''Only accept numbers
If Not e.KeyChar.IsDigit(e.KeyChar.ToString) Then
e.Handled = True
End If
End Sub
அசல் கருத்துகள் (3)
வேபேக் மெஷினிலிருந்து (Wayback Machine) மீட்டெடுக்கப்பட்டது