You can do this with regular expressions as mentioned in other replies to
your post.
Or you can create a function, say StringToInt("42");
Here's some code which does pretty much what StringToInt() might do
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
string s = textBox1.Text;
int num = IsNumber(s);
}
private bool IsNumber (string astr)
{
try {
int i = Convert.ToInt32(astr);
return (true);
}
catch (System.Exception) {
return (false);
}
}
maybe something like that?
hth,
J
"Stefan Richter" <sp**@spammenot.com> wrote in message
news:c7***********@otis.netspace.net.au...
Okay,
so I really have to do that all by myself,
character for character??
???
Isn't there some function that automatically does it?
Thanks,
Stefan