I am trying to disable people from deleting a textbox in a richtextbox. The project is using windows form.
Here is the code I have:
private void
Per the MSDN documentation on KeyPressEventArgs.KeyChar, you cannot get or set the DELETE key using that event. You will need to use the KeyEventArgs.KeyCode instead, subscribing to the KeyDown and KeyUp events.
KeyDown
KeyUp