If you are only going to do this in one place then you can do something like
this:
private void textBox1_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
e.Handled = !char.IsDigit(e.KeyChar);
}
Keep in mind the above code doesn't acct. for BackSpace, ., -, +, e
--
Thanks
Wayne Sepega
Jacksonville, Fl
Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Steve Walker" <st***@otolith.demon.co.uk> wrote in message
news:pJ**************@otolith.demon.co.uk...
In message <#w**************@TK2MSFTNGP12.phx.gbl>, l@?.?.invalid writesHello,
how can i do this:
Subclass TextBox.
--
Steve Walker