TAdvTaskDialog from VCL UI Pack ( current version and lower ) not working.
I cannot reproduce this.
Please provide a sample source project + provide information about what Delphi version you use with which we can reproduce this here.
When I drop a TAdvTaskDialog on the form and add the code in a button OnClick handler:
procedure TForm3.Button1Click(Sender: TObject);
That's correct. But TAdvTaskDialog is never closed...
I have a similar issue with TAdvTaskDialog: I want to display a ProgressBar and update and close it from a separate process. However, the process does not run while the TaskDialog (with Option doProgressBar) is open:
AdvTaskDialog1.Title:= 'Internal Restore ';
AdvTaskDialog1.Instruction:= 'Restoring your internal backup database...';
Until the OK button closes the dialog, the FormBackup.InternalRestore function is not called. Also, an OK button is not needed when using the doProgressBar option; the dialog should be closable from the FormBackup.InternalRestore method.
It would seem that I cannot achieve what I want with this component. Is that correct or am I missing something?
The TAdvTaskDialog.Execute is blocking for the main thread.
To monitor progress of an operation, you'd typically start this operation in a separate thread and then show the TAdvTaskDialog with progress indication. In this scenario, the TAdvTaskDialog will trigger the OnDialogProgress event from where you can update the progress position from the information of your operation thread
That's what I thought. I can do that, but the TaskDialog 'OK' button is not appropriate for a ProgressBar option - it seems to be there by default and I can't get rid of it.
There is always minimum one button displayed.
For progress, you might want to have a Cancel button to cancel lengthy operations.
If you add cancel, you will not see the OK button.
I take your point, but they are all short-term operations which I would not want to have cancelled in mid file(s) transfer. Perhaps the OK button could be removable in a future upgrade.
We'll need to investigate if we can make the dialog appear with any button.