主题:[讨论]通过调用某事件的处理函数,模拟该事件发生,错在哪里?
下一函数是OnClose事件的处理函数
procedure Tmain_Form.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if MessageDlg('Close application ?', mtConfirmation,
[mbYes, mbNo], 0) = mrYes then
Action := caFree
else
Action := caNone;
end;
下面是在一菜单单击
procedure Tmain_Form.N14Click(Sender: TObject);
var Action: TCloseAction ;//type TCloseAction = (caNone, caHide, caFree, caMinimize);
begin
main_Form.FormClose(main_Form,Action);
//main_Form.OnClose(main_Form,Action);
end;
单击后对话框有,但没有关闭窗体.错在哪?
procedure Tmain_Form.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if MessageDlg('Close application ?', mtConfirmation,
[mbYes, mbNo], 0) = mrYes then
Action := caFree
else
Action := caNone;
end;
下面是在一菜单单击
procedure Tmain_Form.N14Click(Sender: TObject);
var Action: TCloseAction ;//type TCloseAction = (caNone, caHide, caFree, caMinimize);
begin
main_Form.FormClose(main_Form,Action);
//main_Form.OnClose(main_Form,Action);
end;
单击后对话框有,但没有关闭窗体.错在哪?