Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable closure of the main form in Borland C++

Tags:

c++builder

vcl

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.

like image 868
dragan.stepanovic Avatar asked Dec 06 '25 06:12

dragan.stepanovic


1 Answers

In the form's FormCloseQuery, set CanClose to false.

like image 157
dwc Avatar answered Dec 08 '25 01:12

dwc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!