private void onKeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && char.IsDigit(e.KeyChar) &&(e.KeyChar != '.')) { e.Handled = true; } // only allow one decimal point if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1)) { e.Handled = true; } txtResult.text = e.keyChar; }
$(document).ready(function () { textbox1.focus(); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)