I have the same error in version 1.1. This seems to be related to the TaskDialogCommandLink class toString string.Format with Environment.NewLine , which does not display cleanly when passed to TaskDialog itself.
public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "{0}{1}{2}", Text ?? string.Empty, (!string.IsNullOrEmpty(Text) && !string.IsNullOrEmpty(instruction)) ? Environment.NewLine : string.Empty, instruction ?? string.Empty); }
In any case, I use an implementation subclass to simplify the arguments and overload the method to pass a line containing a simple "\ n", although I do not need to internationalize my application, and so I can do something a little easier.
public override string ToString() { string str; bool noLabel = string.IsNullOrEmpty(this.Text); bool noInstruction = string.IsNullOrEmpty(this.Instruction); if (noLabel & noInstruction) { str = string.Empty; } else if (!noLabel & noInstruction) { str = this.Text; } else if (noLabel & !noInstruction) { str = base.Instruction; } else { str = this.Text + "\n" + this.Instruction; } return str; }
Dougm source share