I have a form with a custom control. Suppose user control has focus. If I show a message box from this form, when the message box is closed by pressing Enter, either OK or Cancel, the message box closes, and then the user control receives a keyboard event (OnKeyUp) with the key entered.
This does not happen if the space bar is used to βpressβ either the OK or Cancel button.
As MessageBox does not use the Enter key for some reason. I tried this with the Key KeyReview property but there was no difference.
Does anyone know how to stop this message after it is used to press the MessageBox button?
source
share