[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple-button Message boxes not behaving according to documentation
[Thread Prev] | [Thread Next]
- Subject: Re: Multiple-button Message boxes not behaving according to documentation
- From: Gianluigi <gradobag@xxxxxxxxxxx>
- Date: Mon, 15 Jul 2024 22:27:02 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Il 15/07/24 21:36, T Lee Davidson ha scritto:
The documentation states: [quote] The last button is always assumed to be the cancel and the default button. This is the same button that is triggered when you close the message box with the ESCAPE key. In other words, the default action should always do nothing. [/quote] However, given the following code in a Qt5 graphical application: [code] Public Sub Form_Close() If Message.Question("Are you sure you wish to quit.", "Yes", "Cancel") = 2 Then Stop Event End [/code] The default button is the first one. It is shown highlighted and is activated when Return/Enter is pressed. The Esc button activates the Cancel button as expected.
Hi Lee and so: Public Sub Form_Close() Message.DefaultButton = False If Message.Question("Are you sure you wish to quit.", "Yes", "Cancel") = 2 Then Stop Event End Regards Gianluigi
Re: Multiple-button Message boxes not behaving according to documentation | Gianluigi <gradobag@xxxxxxxxxxx> |
Multiple-button Message boxes not behaving according to documentation | T Lee Davidson <t.lee.davidson@xxxxxxxxx> |