TMSFNCTaskDialog: Change Button background colour and icon?


Is it possible to change background or/and the icon of the buttons of the TMSFNCTaskDialog?
For example the Ok and Cancel buttons.

Thank you!


We don't have out of the box setters for these as the buttons you see are simple TButton controls, so you need to style them the way they'd be styled normally. In FMX that means using styles.

You can assign a TStyleBook to the underlying dialog form by setting it in the OnDialogCreated event:

procedure TForm1.TMSFNCTaskDialog1DialogCreated(Sender: TObject);
  TMSFNCTaskDialog1.DialogForm.StyleBook := StyleBook1;

We'll need to investigate if there is a way to provide access to the list of TButton controls so individual styles can be assigned.

Hi Tünde,

Thank you very much for your reply.
The reason I wrote this that one of my customers wants the OK button to be green and the Cancel button to be red so as his colleagues won't click on the wrong button unintentionally (to be easily distinguished).

Hi Zsolt,

We'll need to investigate what are the possibilities as without access to the button list I doubt you can individually configure the style of the buttons. I've put this on our todo list.

Hi Tünde,

Thank you very much!