void __fastcall OnKeyUp(System::TObject* Sender, Word &Key, Classes::TShiftState Shift); { switch( Key ) { case VK_DELETE: if (edit1->text == "") break; } }