1. How to limit Textbox only enter numbers (including decimal)?
private void TextBox_KeyPress (object sender, System.Windows.Forms.KeyPressEventArgs e) {TextBox txt = (TextBox) sender; if (e.KeyChar == 8) {return;} if (e.KeyChar == 46 && txt.Text == - 1) {return;}} (e.keychar> 57 || E.keychar <48) {E.handled = true; this.focus ();}}