Nevron Forum

DefaultButtonId value when using PredefinedButtons

https://www.nevron.com/Forum/Topic5762.aspx

By Brad Swearingen - Wednesday, October 26, 2011

 

How do you set the DefaultButtonId when using the PredefinedButtons like in the code below?

using (NTaskDialog dlg = new NTaskDialog())

{

dlg.PredefinedButtons = TaskDialogButtons.Yes | TaskDialogButtons.No;

dlg.DefaultButtonId = (int)TaskDialogButtons.No; // ??? doesn't work ???

dlg.Title = "title";

dlg.Content.Image = NSystemImages.Warning;

dlg.Content.ImageSize = new NSize(32, 32);

dlg.Content.Text = "msg";

rc = (DialogResult)dlg.Show(this);

}

By Nevron Support - Wednesday, October 26, 2011

Hi Brad,

You should use DialogResult enum instead.
By Brad Swearingen - Wednesday, October 26, 2011

Thanks, that worked great.  I couldn't find that documented any place.