Now that we have added a Kryptonized version of the MessageBox it seems reasonable to keep that theme going and add a Krypton version of the TaskDialog. For those not familiar with the TaskDialog it’s a feature added with Windows Vista and is essentially a MessageBox on steroids.
I would however point out that our Krypton version is not intended as an exact copy. It is very similar but it might not contain absolutely everything that is possible with the operating system version of the dialog. However, something is better than nothing and so here is what we have.
The most basic settings allow for a window title, main instructions, content details, associated icon and the specification of dialog buttons. You can omit any of these values in which case they will not be displayed. Here is an example of the dialog when they have all been specified with simple values…
You can optionally define a CheckBox that is presented in the same area as the dialog buttons. You can define the text for the control as well as the initial checked state. This is more useful than it might first appear. A common scenario is to present warning messages to the user, but ff the user finds these annoying the checkbox could be checked to indicate that the warnings should be suppressed in the future. Or maybe the checkbox is used to indicate that the selected option should always be used in the future without the need to ask again.
Additional information can be shown to the user in the footer area of the dialog. You can set an image, footer text and hyperlink text for this area or any combination of the three values. This is very useful if you want to allow additional help documentation or webpages to be shown in response to a hyperlink being pressed.
Use the radio button feature to present a multiple choice to the user. A simple collection property is used to specify the list of possible options and the selected value is available as a property on the KryptonTaskDialog class when the dialog has been removed.
This is similar to the radio buttons except the choices are presented as a set of buttons. Each button is assigned a DialogResult value and so on return from the dialog being dismissed you can check the return DialogResult to see which command was selected by the user.
As an extreme example you could even specify all the possible features and show the following…
…although I am not sure your users would appreciate such a monstrosity!