AcceptButton & Show()
-
Is it a bug of a feature that AcceptButton only seems to work with Form.ShowDialog() and not with Form.Show()? That is, when a form is displayed with Show(), the Enter key is ignored, but with ShowDialog(), the Enter key causes the form to be accepted (OK). Arun
-
Is it a bug of a feature that AcceptButton only seems to work with Form.ShowDialog() and not with Form.Show()? That is, when a form is displayed with Show(), the Enter key is ignored, but with ShowDialog(), the Enter key causes the form to be accepted (OK). Arun
Hmm... would that be because the modal nature of a dialog box? It seems logical to me that a modal dialog could be dismissed with an accept button, but not necessarily a modeless form.
-
Is it a bug of a feature that AcceptButton only seems to work with Form.ShowDialog() and not with Form.Show()? That is, when a form is displayed with Show(), the Enter key is ignored, but with ShowDialog(), the Enter key causes the form to be accepted (OK). Arun
I think that it has to do with the
ShowDialog
[^] form being modal, and thatShow
[^] is inherited fromControl
[^], which only makes the Form visible. When it's modal, it's usually a form in which the user has to give some input, and press Enter to accept (or Esc to cancel). - Daniël PelsmaekerThere are
10
kinds of people in the world. Those that understand binary and those that do not.