The UltraMessageBoxManager forms can be closed using Alt+F4. When this occurs, they do not return with one of the expected DialogResult values. The x in the upper right-hand corner is disabled (which should normally indicate that they have to select one of the available options to continue and cannot close the form with Alt+F4).
The standard Windows MessageBox form cannot be closed with Alt+F4. You always have to click a button (or press enter/escape). As a result, they always return one of the expected DialogResult values. Is there a way to disallow the user from closing an UltraMessageBoxManager form with Alt+F4? Is this a bug or how it is supposed to work?
Hi,
I tried this out with a variety of different settings and options, but in all cases, both the inbox MessageBox and the UltraMessageBox display with the close button enabled and Alt+F4 works for both of them.
Can you post the code you are using to show the MessageBox so I can use the same options you are using?
Here is the code:
if (DialogResult.Yes != UltraMessageBoxManager.Show("Are you sure you would like to remove this appointment?", "Remove Appointment", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)) return;
A screenshot of the message box is attached. Notice that the close button in the right-hand corner is disabled. Alt+F4 causes the message box to be closed with a DialogResult value of Cancel (which is not Yes or No). The standard Windows MessageBox does not allow the message box to be closed with the same exact parameters.
Windows version:
if (DialogResult.Yes != MessageBox.Show("Are you sure you would like to remove this appointment?", "Remove Appointment", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)) return;