I would like to make one numeric-only textbox. I\'d like to then add that same to the control toolbox within Visual Studio 2008
I\'ve already built the function to a
This is how you can create numeric TextBox:
TextBox
public class NumericTextBox : TextBox { protected override void OnKeyPress(KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } base.OnKeyPress(e); } }