TextBox
Managed C++/CLI
4
Posts
2
Posters
0
Views
1
Watching
-
Dear Sir, I need to capture only decimal number in my TextBox field on my form, how can I control that ?
-
void OnKeyPress(System::Windows::Forms::KeyPressEventArgs^ e)override { if((e->KeyChar=='.')) { if(this->Text->Contains(".")) e->Handled = true; } if(!(wchar_t::IsDigit(e->KeyChar) || wchar_t::IsControl(e->KeyChar))) e->Handled = true; }
Nigah M Manzoor