如何在Borland C ++中禁用主窗体的关闭

时间:2009-02-24 23:30:14

标签: 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.

1 个答案:

答案 0 :(得分:6)

在表单FormCloseQuery中,将CanClose设置为false。