System::String str = this->textBox1->Text;
int matches = 0;
for (int i = 0; i < str.Length; i++) {
if (System::Char::IsDigit(str, i)) ++matches;
}
if (matches != str.Length) {
// error
} else {
// ok
}
Не проверял, но примерно так будет выглядеть.
з.ы. или так
Код:
System::String str = this->textBox1->Text;
int matches = 0;
for (int i = 0; i < str.Length; i++) {
if (System::Char::IsDigit(str.Chars[i])) ++matches;
}
if (matches != str.Length) {
// error
} else {
// ok
}
Последний раз редактировалось rudvil; 27.04.2010 в 17:10..