unit DCloseQuestion; interface uses Define, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons; type TDlgCloseQuestion = class(TForm) btnHide: TBitBtn; btnExit: TBitBtn; chMsg: TCheckBox; private { Private declarations } public { Public declarations } Constructor Create(aOwner: TComponent); override; Destructor Destroy; override; end; var DlgCloseQuestion: TDlgCloseQuestion; implementation uses ManagerConfig; {$R *.dfm} Constructor TDlgCloseQuestion.Create(aOwner: TComponent); begin Inherited Create(aOwner); Caption := Format('%s %s', [APP_NAME, APP_VER]); end; Destructor TDlgCloseQuestion.Destroy; begin if chMsg.Checked then begin case ModalResult of mrOk : gCfg.CloseBtnEvent := cbeHide; mrClose : gCfg.CloseBtnEvent := cbeExit; end; gCfg.SaveConfig; end; Inherited; end; end.