TTMSFNCTaskDialog Cancel button


In TMSFNCTaskDialog demo, you check the modal results in the code:

  mr := TMSFNCTaskDialog1.Execute;

  case mr of
    mrOk: Label18.Caption := 'OK clicked';
    mrYes: Label18.Caption := 'Yes clicked';
    mrNo: Label18.Caption := 'No clicked';
    mrCancel: Label18.Caption := 'Cancelled';
    mrClose: Label18.Caption := 'Close clicked';
    mrAbort: Label18.Caption := 'Aborted';
    Label18.Caption := IntToStr(mr);

However I could find only two button options:

  • If DisplayedButtons= tdbDefault then only the OK button can be seen
  • If DisplayedButtons= tdbNon then there are no buttons

How can I show the Cancel button? I tried Options.tdoAllowDialogCancel, but it doesn't show an actual button next to OK button. On Windows there is the small X button on the top right side, but on Android, there is no extra button.

Thank you very much for your help!


Do I understand correctly that you want to show a cancel button only? Did you try the CommonButtons property? Just check tcbCancel at designtime or you can do the following at at runtime:

TMSFNCTaskDialog1.CommonButtons := [tcbCancel];
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.