1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Android (XE7) CanClose do not work

Discussion in 'Delphi Help&Requests' started by HoewonLee, Oct 14, 2014.

  1. HoewonLee
    Offline

    HoewonLee Guest

    procedure TFmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    begin
      try
        MessageDlg('Exit Application?', System.UITypes.TMsgDlgType.mtInformation,
          [
            System.UITypes.TMsgDlgBtn.mbYes,
            System.UITypes.TMsgDlgBtn.mbNo
          ], 0,
          procedure(const AResult: TModalResult)
          begin
            if AResult = mrYES then
              begin
               CanClose:=True;  //  CanClose  Do not work on android  Why? < XE7 >
              end
                else
            if AResult = mrNo then
              begin
               CanClose:= False;
              end;
          end);
      except on E:Exception do ShowMessage(e.Message);
      end;
    end;
     
  2. realist
    Online

    realistrealist is a Verified Member Administrator General Staff Member DF Staff

    uses FMX.Helpers.Android;
    ...
    procedure TFmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    begin
     if MessageDlg('Exit Application?',
            TMsgDlgType.mtConfirmation,[TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0, TMsgDlgBtn.mbNo) = mrYes  then
       begin
          CanClose := True;
          SharedActivity.finish
       end
     else
      begin
        CanClose := False;
        //ShowMessage('You no answered);
      end;
    end;
     

Share This Page