Essence: it is necessary (among other things) to block the entry of a semicolon. Here is the KeyDown and KeyPress event code for the tbGroup textbox.

private: System::Void tbGroup_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { IncorSymbEntered = false; if ( (e->KeyCode == Keys::OemSemicolon) || ((Control::ModifierKeys == Keys::Shift) && (e->KeyCode == Keys::Oem4))) IncorSymbEntered = true; } private: System::Void tbGroup_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) { if (IncorSymbEntered) e->Handled = true; } 

The first condition in keydaun fulfills, but also blocks the input of the letter "g", which is inappropriate. The second just for some reason does not work, a semicolon is entered. Tell me, please, how to fix it. Just blocking letters / numbers for other textboxes turned out, but I don’t know how.

    0