private void codeTextbox_AfterKeyDown(object sender, KeyEventArgs e) { if (TextFile == null) { return; } switch (e.KeyCode) { case Keys.Delete: case Keys.Back: openAutoComplete(); checkAutoComplete(); break; default: break; } bool autoCompleteFormActive = (autoCompleteForm != null && autoCompleteForm.Visible); if (snippet != null) { snippet.AfterKeyDown(sender, e, autoCompleteForm); } TextFile.AfterKeyDown(e); }