Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
754
UltraButton AcceptsFocus property disables key events?
posted

Dear all,

WinForms 10.3: we have modal form called with

.....form.ShowDialog() == DialogResult.Ok;

and the form contains UltraButton instances for Ok and Cancel. For some strange reason, pressing ESC was not closing the form when the Cancel button was set to the CancelButton property of the form. So my developer played around and found that if AcceptsFocus is set to true for the Cancel button, the ESC keypress closed the window, but not if AcceptsFocus is set to false.

The reason for disabling this that we do not want to have the focus border around the cancel button immediatley after startup (prevent the thick border there).

But even if we have to just make a workaround and manually shift the focus upon activation, shouldn´t be the ESC button bound in any way to the CancelButton property in such a way that it does not need to have the focus?

Thanks and regards Florian