Enter only a number in TextBox

xiaoxiao2021-03-05  27

Public void keypressnum (KeyPressEventArgs E)

{

IF (! char.isnumber (e.Keychar) && E.Keychar! = (char) 8 && E.Keychar! = (char) 46)

e.handled = true;

}

Then call this function in the TextBox Click on the event.

转载请注明原文地址:https://www.9cbs.com/read-34472.html

New Post(0)