Hello programmers out there again :)
Im using this code (Thanks to adatapost):
private: System::Void textBox1_KeyPress(System::Object^sender,System::Windows::Forms::KeyPressEventArgs^ e)
{
if(Char::IsDigit(e->KeyChar))
return;
if(e->KeyChar=='\b')
return;
if(e->KeyChar=='-')
return;
e->Handled=true;
}
To allows only digits, backspace and "-"
But the problem is that you can put the "-" anywhere and as
often as you want into the textbox. So, any suggestions on
how to make a "1 - limit" and a check if its the first letter in the textbox ?
Help is greatly appreciated.