How to disable closure of the main form in Borland C++
-
06-09-2019 - |
Question
When closing an application on close button (FormClose handler is called), there is a dialog if user is sure that he wants to close the application. If the result of the dialog is mrCancel, then I try to set the ModalResult of a main form to mrNone like I do with other forms, but even though, the application still closes. What is the solution? Cheers.
Solution
In the form's FormCloseQuery
, set CanClose
to false.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow