This project has moved and is read-only. For the latest updates, please go here.

Programatically close a TaskDialog

Jul 10, 2009 at 4:52 PM

Hi,

how can I programatically close a TaskDialog and/or programatically press a button?

Jul 14, 2009 at 8:22 AM

You can use the CancelCommand to close the dialog.

There's no simple way currently to emulate a button press, but you can add actual Button instances to the Buttons collection and then use the automation peer to click the button.

Perhaps a better way (depending on your code) is to simply cancel the dialog and save the required state somewhere.