Не вызывается корректоно Close формы

artzub
Дата: 08.06.2009 12:53:44
Привет!

Закрываю форму из поцедуры вот так:
if Assigned(curSplashForm) then
    begin
        curSplashForm.CanCloseForm := true;
        if curSplashForm.cxCheckBox_Close.Checked then
        begin
            curSplashForm.SetFocus();            
        	 curSplashForm.Close();
            FreeAndNil(curSplashForm);
        end;
    end;

но при этом почемуто не вызывается стандарные события:
procedure TCustomForm.Close;
var
  CloseAction: TCloseAction;
begin
  if fsModal in FFormState then
    ModalResult := mrCancel
  else
    if CloseQuery then
    begin
      if FormStyle = fsMDIChild then
        if biMinimize in BorderIcons then
          CloseAction := caMinimize else
          CloseAction := caNone
      else
        CloseAction := caHide;
      DoClose(CloseAction);
      if CloseAction <> caNone then
        if Application.MainForm = Self then Application.Terminate
        else if CloseAction = caHide then Hide
        else if CloseAction = caMinimize then WindowState := wsMinimized
        else Release;
    end;
end;

Почему!!!???
____________________________________________________________________________________
Жизнь хитрая штука - как только все карты на руках — она решает сыграть с тобой в шахматы!
MikeDD
Дата: 08.06.2009 15:59:29
Вместо .Close используй .Release